#48: add logout all link on choose account panel

This commit is contained in:
SleepWalker
2016-11-19 14:19:23 +02:00
parent 13b4dcbbe8
commit 79a9efb561
10 changed files with 20 additions and 9 deletions

View File

@@ -1,6 +1,6 @@
import { routeActions } from 'react-router-redux';
import { updateUser, logout as logoutUser, acceptRules as userAcceptRules } from 'components/user/actions';
import { updateUser, logout, acceptRules as userAcceptRules } from 'components/user/actions';
import { authenticate } from 'components/accounts/actions';
import authentication from 'services/api/authentication';
import oauth from 'services/api/oauth';
@@ -24,6 +24,7 @@ export function login({login = '', password = '', rememberMe = false}) {
} else if (resp.errors.login === ACTIVATION_REQUIRED) {
return dispatch(needActivation());
} else if (resp.errors.login === LOGIN_REQUIRED && password) {
// TODO: log this case to backend
// return to the first step
return dispatch(logout());
}
@@ -143,9 +144,7 @@ export function clearErrors() {
return setErrors(null);
}
export function logout() {
return logoutUser();
}
export { logout, updateUser } from 'components/user/actions';
/**
* @param {object} oauthData

View File

@@ -1,5 +1,6 @@
{
"chooseAccountTitle": "Choose an account",
"addAccount": "Log into another account",
"logoutAll": "Log out from all accounts",
"description": "You have logged in into multiple accounts. Please choose the one, you want to use to authorize {appName}"
}

View File

@@ -7,5 +7,10 @@ export default factory({
body: Body,
footer: {
label: messages.addAccount
}
},
links: [
{
label: messages.logoutAll
}
]
});