kopia lustrzana https://gitlab.com/soapbox-pub/soapbox
Sentry: unset the Sentry account when appropriate
rodzic
e2b8a74e91
commit
b2c766c8ce
|
@ -17,6 +17,7 @@ import { startOnboarding } from 'soapbox/actions/onboarding';
|
|||
import { custom } from 'soapbox/custom';
|
||||
import { queryClient } from 'soapbox/queries/client';
|
||||
import { selectAccount } from 'soapbox/selectors';
|
||||
import { unsetSentryAccount } from 'soapbox/sentry';
|
||||
import KVStore from 'soapbox/storage/kv-store';
|
||||
import toast from 'soapbox/toast';
|
||||
import { getLoggedInAccount, parseBaseURL } from 'soapbox/utils/auth';
|
||||
|
@ -220,6 +221,9 @@ export const logOut = () =>
|
|||
queryClient.invalidateQueries();
|
||||
queryClient.clear();
|
||||
|
||||
// Clear the account from Sentry.
|
||||
unsetSentryAccount();
|
||||
|
||||
dispatch({ type: AUTH_LOGGED_OUT, account, standalone });
|
||||
|
||||
toast.success(messages.loggedOut);
|
||||
|
|
|
@ -53,4 +53,10 @@ async function setSentryAccount(account: Account) {
|
|||
});
|
||||
}
|
||||
|
||||
export { startSentry, setSentryAccount };
|
||||
/** Remove the account from Sentry events. */
|
||||
async function unsetSentryAccount() {
|
||||
const Sentry = await import('@sentry/react');
|
||||
Sentry.setUser(null);
|
||||
}
|
||||
|
||||
export { startSentry, setSentryAccount, unsetSentryAccount };
|
Ładowanie…
Reference in New Issue