mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Auth: Fix redirection in case of ERR_TOKEN_REVOKED (#94137)
Fix redirection in case of token revoked error
This commit is contained in:
parent
573ba9be18
commit
ddbbf8df4b
@ -382,6 +382,7 @@ export class BackendSrv implements BackendService {
|
||||
},
|
||||
})
|
||||
);
|
||||
this.dependencies.contextSrv.setRedirectToUrl();
|
||||
return throwError(() => error);
|
||||
}
|
||||
|
||||
|
@ -120,16 +120,20 @@ export class ContextSrv {
|
||||
* Indicate the user has been logged out
|
||||
*/
|
||||
setLoggedOut() {
|
||||
this.setRedirectToUrl();
|
||||
this.cancelTokenRotationJob();
|
||||
this.user.isSignedIn = false;
|
||||
this.isSignedIn = false;
|
||||
window.location.reload();
|
||||
}
|
||||
|
||||
setRedirectToUrl() {
|
||||
if (config.featureToggles.useSessionStorageForRedirection) {
|
||||
window.sessionStorage.setItem(
|
||||
RedirectToUrlKey,
|
||||
encodeURIComponent(window.location.href.substring(window.location.origin.length))
|
||||
);
|
||||
}
|
||||
this.cancelTokenRotationJob();
|
||||
this.user.isSignedIn = false;
|
||||
this.isSignedIn = false;
|
||||
window.location.reload();
|
||||
}
|
||||
|
||||
hasRole(role: string) {
|
||||
|
Loading…
Reference in New Issue
Block a user