mirror of
https://github.com/elyby/accounts-frontend.git
synced 2024-11-16 05:03:02 +05:30
Добавлено поле для разлогивания всех авторизованных устройств при смене пароля (пока без имплементации)
This commit is contained in:
parent
4a484027de
commit
80956a840e
@ -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]];
|
||||||
|
@ -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({
|
||||||
|
Loading…
Reference in New Issue
Block a user