I am trying to implement passwordless authentication with Auth0 and angular2 (2.0.0-rc.6), using angular2-webpack-starter and auth0-lock-passwordless.
The form displays normally, and the authentication e-mail is sent using this code:
this.lock.magiclink({
callbackURL:"http://localhost:3000/#/sandbox"
});
The issues occur after I click the magic link in the e-mail:
Even though the redirect_uri of the magic link seems correct (redirect_uri=http%3A%2F%2Flocalhost%3A3000%2F%23%2Fsandbox), it is ignored;
Instead, after a successful login (checked in Auth0 logs), the url in the address bar is (briefly): http://localhost:3000/#access_token=xxxxxxxxxx&id_token=yyyyyyyyy&[email protected] (notice the # instead of expected question mark)
then (after a second or so) it redirects to: http://localhost:3000/#/access_token
My questions are:
- How to have Auth0 actually redirect to callbackURL?
- How can I catch the token with the new angular2 router, even though the uri is misformed? (question mark missing before the query)