(auth) Made the renewing token on "sign-in-with-token" process an optional step to simplify the login process

This commit is contained in:
Sercan Yemen 2022-05-24 12:42:23 +03:00
parent 6eff4a1898
commit a6d64b1747

View File

@ -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;