mirror of
https://github.com/richard-loafle/fuse-angular.git
synced 2025-01-08 19:45: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) => {
|
switchMap((response: any) => {
|
||||||
|
|
||||||
// Store the access token in the local storage
|
// Replace the access token with the new one if it's available on
|
||||||
this.accessToken = response.accessToken;
|
// 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
|
// Set the authenticated flag to true
|
||||||
this._authenticated = true;
|
this._authenticated = true;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user