Catch logout error (#17139)

This commit is contained in:
ian
2023-01-14 02:01:38 +08:00
committed by GitHub
parent 5e555f7756
commit 3bd2c1cfd3

View File

@@ -170,7 +170,11 @@ export async function logout(optionsRaw: LogoutOptions = {}): Promise<void> {
// Only if the user manually signed out should we kill the session by hitting the logout endpoint
if (options.reason === LogoutReason.SIGN_OUT) {
await api.post(`/auth/logout`);
try {
await api.post(`/auth/logout`);
} catch {
// User already signed out
}
}
appStore.authenticated = false;