Always redirect home when switching between accounts

merge-requests/452/head
Alex Gleason 4 years ago
parent 0ed3e0e3de
commit 706e0ea6ac
No known key found for this signature in database
GPG Key ID: 7211D1F99744FBB7

@ -126,22 +126,7 @@ const reducer = (state, action) => {
}
};
// The user has a token stored in their browser
const canAuth = state => {
state = maybeShiftMe(state);
const me = state.get('me');
const token = state.getIn(['users', me, 'access_token']);
return typeof token === 'string';
};
// Reload, but redirect home if the user is already logged in
const reload = state => {
if (location.pathname === '/auth/sign_in' && canAuth(state)) {
return location.replace('/');
} else {
return location.reload();
}
};
const reload = () => location.replace('/');
// `me` is a user ID string
const validMe = state => {

Loading…
Cancel
Save