Mastodon: clear token on 401 in VERIFY_CREDENTIALS_FAIL

This commit is contained in:
Alex Gleason 2021-09-26 16:30:45 -05:00
parent c5a5c5a6e3
commit 86950dde42
No known key found for this signature in database
GPG key ID: 7211D1F99744FBB7

View file

@ -267,7 +267,7 @@ const reducer = (state, action) => {
case VERIFY_CREDENTIALS_SUCCESS:
return importCredentials(state, action.token, action.account);
case VERIFY_CREDENTIALS_FAIL:
return action.error.response.status === 403 ? deleteToken(state, action.token) : state;
return [401, 403].includes(action.error.response.status) ? deleteToken(state, action.token) : state;
case SWITCH_ACCOUNT:
return state.set('me', action.account.get('url'));
case ME_FETCH_SKIP: