Refreshing in browser changes template in angularJS -


I have a strange problem with my angular application when the user is logged in and hits "refresh" in the browser , Then the app loads the log-in template which is part of the main index.html file. This user is not meant to kill the session, but the user can not get anywhere else in the app without the authentication. Can any person advise?

When a user refreshes the browser, then your entire angle application disappears and restart it happens. In this way SPA ("Single Page App") works.

If you do not want users to log in at all times, you need to save enough information in the browser to know that he or she has already signed in. You can do this by storing some information in a cookie or HTML 5 local storage, and to see if login information is stored before calling your authenticity service.

In addition, if you use standard HTTP Basic authentication, the browser will automatically cache authentication credentials.


Comments