mirror of
https://github.com/plankanban/planka.git
synced 2025-07-18 20:59:44 +02:00
ref: Little change for consistency
This commit is contained in:
parent
cf1fba9267
commit
21cbe527b0
2 changed files with 12 additions and 5 deletions
|
@ -110,17 +110,22 @@ export function* updateUserPassword(id, data) {
|
||||||
yield put(actions.updateUserPassword(id, data));
|
yield put(actions.updateUserPassword(id, data));
|
||||||
|
|
||||||
let user;
|
let user;
|
||||||
let accessToken;
|
let accessTokens;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
({ item: user, accessToken } = yield call(request, api.updateUserPassword, id, data));
|
({ item: user, included: { accessTokens } = {} } = yield call(
|
||||||
|
request,
|
||||||
|
api.updateUserPassword,
|
||||||
|
id,
|
||||||
|
data,
|
||||||
|
));
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
yield put(actions.updateUserPassword.failure(id, error));
|
yield put(actions.updateUserPassword.failure(id, error));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (accessToken) {
|
if (accessTokens && accessTokens[0]) {
|
||||||
yield call(setAccessToken, accessToken);
|
yield call(setAccessToken, accessTokens[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
yield put(actions.updateUserPassword.success(user));
|
yield put(actions.updateUserPassword.success(user));
|
||||||
|
|
|
@ -70,8 +70,10 @@ module.exports = {
|
||||||
const accessToken = sails.helpers.utils.createToken(user.id, user.passwordUpdatedAt);
|
const accessToken = sails.helpers.utils.createToken(user.id, user.passwordUpdatedAt);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
accessToken,
|
|
||||||
item: user,
|
item: user,
|
||||||
|
included: {
|
||||||
|
accessTokens: [accessToken],
|
||||||
|
},
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue