Angular 2+ Custom Login - this.lock.parseHash is not a function error

The custom login quickstart step uses Auth0.js instead of Auth0 Lock. I checked the step you linked and the code is correctly using Auth0.js, more specifically, you have:

declare var auth0: any;
//...
auth0 = new auth0.WebAuth({
    domain: '...',
    clientID: '...',
    // ...
  });
// ...
this.auth0.parseHash(...)
// ...
this.auth0.redirect.loginWithCredentials(...)

However, in your code you’re trying to use Auth0 Lock to call methods that are only available in Auth0.js.

The following is incorrect and explains the parseHash is not defined error:

lock = new Auth0Lock('xxx', 'xxx', options);
//...
this.lock.parseHash(...)
//...
this.lock.redirect.loginWithCredentials(...)
1 Like