refactor: don't try to delete the auth cookie
This commit is contained in:
parent
fd7fec8580
commit
245467155d
|
@ -78,10 +78,6 @@ export class PortalAuthProvider implements RequiredAuthProvider {
|
||||||
|
|
||||||
async logout(params: any): Promise<AuthActionResponse> {
|
async logout(params: any): Promise<AuthActionResponse> {
|
||||||
let ret = await this.sdk.account().logout();
|
let ret = await this.sdk.account().logout();
|
||||||
if (ret) {
|
|
||||||
const cookies = new Cookies();
|
|
||||||
cookies.remove('jwt');
|
|
||||||
}
|
|
||||||
return {success: ret, redirectTo: "/login"};
|
return {success: ret, redirectTo: "/login"};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -90,18 +86,11 @@ export class PortalAuthProvider implements RequiredAuthProvider {
|
||||||
|
|
||||||
const ret = await this.sdk.account().ping();
|
const ret = await this.sdk.account().ping();
|
||||||
|
|
||||||
if (!ret) {
|
|
||||||
const cookies = new Cookies();
|
|
||||||
cookies.remove('jwt');
|
|
||||||
}
|
|
||||||
|
|
||||||
return {authenticated: ret, redirectTo: ret ? undefined : "/login"};
|
return {authenticated: ret, redirectTo: ret ? undefined : "/login"};
|
||||||
}
|
}
|
||||||
|
|
||||||
async onError(error: any): Promise<OnErrorResponse> {
|
async onError(error: any): Promise<OnErrorResponse> {
|
||||||
const cookies = new Cookies();
|
const cookies = new Cookies();
|
||||||
cookies.remove('jwt');
|
|
||||||
this.sdk.setAuthToken('');
|
|
||||||
return {logout: true};
|
return {logout: true};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue