mirror of
https://github.com/richard-loafle/fuse-angular.git
synced 2025-01-08 03:25:08 +00:00
(auth) Made the renewing token on "sign-in-with-token" process an optional step to simplify the login process
This commit is contained in:
parent
6eff4a1898
commit
a6d64b1747
|
@ -107,8 +107,17 @@ export class AuthService
|
|||
),
|
||||
switchMap((response: any) => {
|
||||
|
||||
// Store the access token in the local storage
|
||||
this.accessToken = response.accessToken;
|
||||
// Replace the access token with the new one if it's available on
|
||||
// the response object.
|
||||
//
|
||||
// This is an added optional step for better security. Once you sign
|
||||
// in using the token, you should generate a new one on the server
|
||||
// side and attach it to the response object. Then the following
|
||||
// piece of code can replace the token with the refreshed one.
|
||||
if ( response.accessToken )
|
||||
{
|
||||
this.accessToken = response.accessToken;
|
||||
}
|
||||
|
||||
// Set the authenticated flag to true
|
||||
this._authenticated = true;
|
||||
|
|
Loading…
Reference in New Issue
Block a user