Merge branch 'external-auth-fix' into 'main'
Remove external auth keys when they're done being used See merge request soapbox-pub/soapbox!3039
This commit is contained in:
commit
407432cf39
|
@ -224,6 +224,11 @@ export const logOut = () =>
|
||||||
// Clear the account from Sentry.
|
// Clear the account from Sentry.
|
||||||
unsetSentryAccount();
|
unsetSentryAccount();
|
||||||
|
|
||||||
|
// Remove external auth entries.
|
||||||
|
localStorage.removeItem('soapbox:external:app');
|
||||||
|
localStorage.removeItem('soapbox:external:baseurl');
|
||||||
|
localStorage.removeItem('soapbox:external:scopes');
|
||||||
|
|
||||||
dispatch({ type: AUTH_LOGGED_OUT, account, standalone });
|
dispatch({ type: AUTH_LOGGED_OUT, account, standalone });
|
||||||
|
|
||||||
toast.success(messages.loggedOut);
|
toast.success(messages.loggedOut);
|
||||||
|
|
|
@ -99,5 +99,6 @@ export const loginWithCode = (code: string) =>
|
||||||
.then((token: Record<string, string | number>) => dispatch(authLoggedIn(token)))
|
.then((token: Record<string, string | number>) => dispatch(authLoggedIn(token)))
|
||||||
.then(({ access_token }: any) => dispatch(verifyCredentials(access_token as string, baseURL)))
|
.then(({ access_token }: any) => dispatch(verifyCredentials(access_token as string, baseURL)))
|
||||||
.then((account: { id: string }) => dispatch(switchAccount(account.id)))
|
.then((account: { id: string }) => dispatch(switchAccount(account.id)))
|
||||||
|
.then(() => localStorage.removeItem('soapbox:external:baseurl'))
|
||||||
.then(() => window.location.href = '/');
|
.then(() => window.location.href = '/');
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue