Auth0 Home Blog Docs

Login seems to fail from second login onwards

auth0-angular

#1

I have worked through the following tutorial: https://auth0.com/blog/angular-2-authentication

I have used the source code provided at this repo: https://github.com/auth0-blog/angular-2-authentication-tutorial mentioned in the tutorial in order to re-produce this error.

Reproduce the error as follows:

  • clone the repo
  • run npm install in the server folder
  • run npm install in the ng2-auth folder
  • Spin up the server and angular app mentioned in the tutorial above.
  • navigate to the angular app http://localhost:4200
  • Click the login link on the top right and login for the first time. This should succeed and you should be able to navigate to the private deals page (click on the private deals link).
  • Click on the logout link and attempt to re-login by clicking on the login link. After the second call to the callback url (prompted by the second attempt to login) You should briefly see the private deals url pop into view (indicating that the angular app momentarily recognizes you as being logged in) and then the private deals link will disappear indicating that the app thins you are not logged.
  • Thereafter every attempt to login is met with the same behaviour whereby after the callback url process I am NOT logged in.

I get the above behaviour on Chrome Version 65.0.3325.181 (Official Build) (64-bit) Windows 10 Professional.
I DO NOT get the above behaviour on firefox

Can someone please help explain why I am experiencing this strange behaviour


#2

What error message is it that you’re receiving? Have you looked at our quickstarts as well?


#3

The error I get is: {error: “login_required”, error_description: “Login required”}

Have you managed to re-produce my error?


#4

I am getting a different error as I follow the tutorial but that may be due to issues on my machine I need to resolve. The Angular 2 Quickstart I mention above might give you a better idea of how to integrate than the tutorial.


#5

Were you able to solve this issue?