actions/auth: don't call deprecated DELETE /api/sign_out
This commit is contained in:
parent
ea9a02f7d7
commit
6530fcf37b
|
@ -229,9 +229,6 @@ export const logIn = (username: string, password: string) =>
|
||||||
throw error;
|
throw error;
|
||||||
});
|
});
|
||||||
|
|
||||||
export const deleteSession = () =>
|
|
||||||
(dispatch: AppDispatch, getState: () => any) => api(getState).delete('/api/sign_out');
|
|
||||||
|
|
||||||
export const logOut = () =>
|
export const logOut = () =>
|
||||||
(dispatch: AppDispatch, getState: () => RootState) => {
|
(dispatch: AppDispatch, getState: () => RootState) => {
|
||||||
const state = getState();
|
const state = getState();
|
||||||
|
@ -246,10 +243,7 @@ export const logOut = () =>
|
||||||
token: state.auth.getIn(['users', account.url, 'access_token']),
|
token: state.auth.getIn(['users', account.url, 'access_token']),
|
||||||
};
|
};
|
||||||
|
|
||||||
return Promise.all([
|
return dispatch(revokeOAuthToken(params)).finally(() => {
|
||||||
dispatch(revokeOAuthToken(params)),
|
|
||||||
dispatch(deleteSession()),
|
|
||||||
]).finally(() => {
|
|
||||||
dispatch({ type: AUTH_LOGGED_OUT, account, standalone });
|
dispatch({ type: AUTH_LOGGED_OUT, account, standalone });
|
||||||
return dispatch(snackbar.success(messages.loggedOut));
|
return dispatch(snackbar.success(messages.loggedOut));
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue