Добавлено поле для разлогивания всех авторизованных устройств при смене пароля (пока без имплементации)

This commit is contained in:
ErickSkrauch 2016-04-25 00:30:10 +03:00
parent 4a484027de
commit 80956a840e
2 changed files with 4 additions and 3 deletions

View File

@ -49,7 +49,7 @@ export function changePassword({
newRePassword = '' newRePassword = ''
}) { }) {
return wrapInLoader((dispatch) => return wrapInLoader((dispatch) =>
dispatch(changeUserPassword({password, newPassword, newRePassword})) dispatch(changeUserPassword({password, newPassword, newRePassword, logoutAll : false}))
.catch((resp) => { .catch((resp) => {
if (resp.errors) { if (resp.errors) {
const errorMessage = resp.errors[Object.keys(resp.errors)[0]]; const errorMessage = resp.errors[Object.keys(resp.errors)[0]];

View File

@ -47,12 +47,13 @@ export function fetchUserData() {
export function changePassword({ export function changePassword({
password = '', password = '',
newPassword = '', newPassword = '',
newRePassword = '' newRePassword = '',
logoutAll = true,
}) { }) {
return (dispatch) => return (dispatch) =>
request.post( request.post(
'/api/accounts/change-password', '/api/accounts/change-password',
{password, newPassword, newRePassword} {password, newPassword, newRePassword, logoutAll}
) )
.then((resp) => { .then((resp) => {
dispatch(updateUser({ dispatch(updateUser({