Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/manager/src/OAuth/oauth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ function clearNonceAndCodeVerifierFromLocalStorage() {
storage.authentication.codeVerifier.clear();
}

function clearAllAuthDataFromLocalStorage() {
export function clearAllAuthDataFromLocalStorage() {
clearNonceAndCodeVerifierFromLocalStorage();
clearAuthDataFromLocalStorage();
}
Expand Down
11 changes: 7 additions & 4 deletions packages/manager/src/request.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ import { AxiosHeaders } from 'axios';
import { ACCESS_TOKEN, API_ROOT, DEFAULT_ERROR_MESSAGE } from 'src/constants';
import { setErrors } from 'src/store/globalErrors/globalErrors.actions';

import { clearAuthDataFromLocalStorage, redirectToLogin } from './OAuth/oauth';
import {
clearAllAuthDataFromLocalStorage,
redirectToLogin,
} from './OAuth/oauth';
import { getEnvLocalStorageOverrides, storage } from './utilities/storage';

import type { ApplicationStore } from './store';
Expand Down Expand Up @@ -33,7 +36,7 @@ export type LinodeError = { errors: APIError[] };
*/
let isRedirectingToLogin = false;

export const handleError = (
export const handleError = async (
error: AxiosError<LinodeError>,
store: ApplicationStore
) => {
Expand All @@ -45,8 +48,8 @@ export const handleError = (
window.location.pathname !== '/oauth/callback'
) {
isRedirectingToLogin = true;
clearAuthDataFromLocalStorage();
redirectToLogin();
clearAllAuthDataFromLocalStorage();
await redirectToLogin();
}

const status: number = error.response?.status ?? 0;
Expand Down
Loading