This commit is contained in:
@@ -77,10 +77,10 @@ export class AuthService {
|
||||
const refreshToken = this.getInternalRefreshToken();
|
||||
this.http.post<{ logoutUrl: string | null }>(`${this.apiUrl}/logout`, {refreshToken}).subscribe({
|
||||
next: (response) => {
|
||||
this.clearSession();
|
||||
if (response.logoutUrl) {
|
||||
window.location.href = response.logoutUrl;
|
||||
} else {
|
||||
this.clearSession();
|
||||
this.router.navigate(['/login']).then(() => window.location.reload());
|
||||
}
|
||||
},
|
||||
@@ -96,6 +96,10 @@ export class AuthService {
|
||||
this.router.navigate(['/login'], {queryParams: {reason}});
|
||||
}
|
||||
|
||||
clearSessionOnLoginPage(): void {
|
||||
this.clearSession();
|
||||
}
|
||||
|
||||
private clearSession(): void {
|
||||
localStorage.removeItem('accessToken_Internal');
|
||||
localStorage.removeItem('refreshToken_Internal');
|
||||
|
||||
Reference in New Issue
Block a user