Revoke OAuth token on logout, fixes #445

chats_paste
Alex Gleason 4 years ago
parent 532e37a347
commit 76b7b32e23
No known key found for this signature in database
GPG Key ID: 7211D1F99744FBB7

@ -145,7 +145,17 @@ export function logIn(username, password) {
export function logOut() {
return (dispatch, getState) => {
const state = getState();
dispatch({ type: AUTH_LOGGED_OUT });
// Attempt to destroy OAuth token on logout
api(getState).post('/oauth/revoke', {
client_id: state.getIn(['auth', 'app', 'client_id']),
client_secret: state.getIn(['auth', 'app', 'client_secret']),
token: state.getIn(['auth', 'user', 'access_token']),
});
dispatch(showAlert('Successfully logged out.', ''));
};
}

Loading…
Cancel
Save