Process login sessions on angular2

Asked 2 years ago, Updated 2 years ago, 136 views

Learning angular2.

From the login page of the angular app

1) Request to log in to the server and get a token back.
2) Save token to cookies or local storage.
3) When accessing a page that requires authentication, if there is no token or if the token is not valid in the api communication return, go to the login page.

Is this how it works to log in from angular?

angular login session

2022-09-22 20:33

1 Answers

In my case, I give a refreshing token.

If the token expires, we sent the refresh_token value again to check the refresh_token value and update the token immediately.

That is, when you go to the login page,

In the case of these three, I think they tried to log in again.


2022-09-22 20:33

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.