mirror of
https://github.com/plankanban/planka.git
synced 2025-12-16 17:23:21 +03:00
ref: Little change for consistency
This commit is contained in:
@@ -110,17 +110,22 @@ export function* updateUserPassword(id, data) {
|
||||
yield put(actions.updateUserPassword(id, data));
|
||||
|
||||
let user;
|
||||
let accessToken;
|
||||
let accessTokens;
|
||||
|
||||
try {
|
||||
({ item: user, accessToken } = yield call(request, api.updateUserPassword, id, data));
|
||||
({ item: user, included: { accessTokens } = {} } = yield call(
|
||||
request,
|
||||
api.updateUserPassword,
|
||||
id,
|
||||
data,
|
||||
));
|
||||
} catch (error) {
|
||||
yield put(actions.updateUserPassword.failure(id, error));
|
||||
return;
|
||||
}
|
||||
|
||||
if (accessToken) {
|
||||
yield call(setAccessToken, accessToken);
|
||||
if (accessTokens && accessTokens[0]) {
|
||||
yield call(setAccessToken, accessTokens[0]);
|
||||
}
|
||||
|
||||
yield put(actions.updateUserPassword.success(user));
|
||||
|
||||
@@ -70,8 +70,10 @@ module.exports = {
|
||||
const accessToken = sails.helpers.utils.createToken(user.id, user.passwordUpdatedAt);
|
||||
|
||||
return {
|
||||
accessToken,
|
||||
item: user,
|
||||
included: {
|
||||
accessTokens: [accessToken],
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user