File tree Expand file tree Collapse file tree
packages/authentication-client/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -29,6 +29,7 @@ export interface AuthenticationClientOptions {
2929 jwtStrategy : string ;
3030 path : string ;
3131 Authentication : ClientConstructor ;
32+ removeTokenOnError ( error ?: Error ) : boolean ;
3233}
3334
3435export class AuthenticationClient {
@@ -107,15 +108,11 @@ export class AuthenticationClient {
107108 } ) ;
108109 }
109110
110- removeTokenOnError ( ) {
111- return true
112- }
113-
114111 removeAccessToken ( error ?: Error ) {
115- if ( this . removeTokenOnError ( error ) ) {
112+ if ( this . options . removeTokenOnError ( error ) ) {
116113 return this . storage . removeItem ( this . options . storageKey ) ;
117114 } else {
118- return Promise . resolve ( )
115+ return Promise . resolve ( ) ;
119116 }
120117 }
121118
Original file line number Diff line number Diff line change @@ -32,7 +32,8 @@ export const defaults: AuthenticationClientOptions = {
3232 jwtStrategy : 'jwt' ,
3333 path : '/authentication' ,
3434 Authentication : AuthenticationClient ,
35- storage : defaultStorage
35+ storage : defaultStorage ,
36+ removeTokenOnError : ( ) => true
3637} ;
3738
3839const init = ( _options : Partial < AuthenticationClientOptions > = { } ) => {
You can’t perform that action at this time.
0 commit comments