auth0-lock provides passwordless - unable to emit events

Hello,

I am using auth0-lock npm library to use passwordless authentication in my single page application.
After signing up with email, I click on the link that is received in my inbox, and it just logs me in, I am unable to get the ‘authenticated’ event, to store the access_token. Trying to use the below code,

    const authOptions = {
       passwordlessMethod: "link",
       auth: {
	     redirectUrl: setting.APP.AUTH_REDIRECT_URL,
	     responseType: 'token id_token'
       },
       allowedConnections: ["email"],
       closable: false,
       defaultDatabaseConnection: setting.APP.AUTH_CONNECTION
   };

    var lock = this.isValid ?
        new Auth0LockPasswordless(
	        setting.AUTH.CLIENT_ID,
	        setting.AUTH.CLIENT_DOMAIN,
     		authOptions) :
        null;

lock.show();

lock.on('authenticated', authResult => {
		console.log("authresult  " + authResult);
		if (authResult && authResult.accessToken) {
			localStorage.setItem('accessToken', authResult.accessToken);
		} else {
			notification('error', 'Wrong mail or password');
		}
	});

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.