Merge pull request '7848-recoveryPassword' (!2858) from 7848-recoveryPassword into dev
gitea/salix/pipeline/head This commit looks good
Details
gitea/salix/pipeline/head This commit looks good
Details
Reviewed-on: #2858 Reviewed-by: Juan Ferrer <juan@verdnatura.es> Reviewed-by: Jorge Penades <jorgep@verdnatura.es>
This commit is contained in:
commit
bad6447b72
|
@ -24,6 +24,10 @@ module.exports = Self => {
|
||||||
arg: 'lang',
|
arg: 'lang',
|
||||||
type: 'string',
|
type: 'string',
|
||||||
description: 'The user lang'
|
description: 'The user lang'
|
||||||
|
}, {
|
||||||
|
arg: 'twoFactor',
|
||||||
|
type: 'string',
|
||||||
|
description: 'The user twoFactor'
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
http: {
|
http: {
|
||||||
|
@ -32,8 +36,8 @@ module.exports = Self => {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
Self.updateUser = async(ctx, id, name, nickname, email, lang) => {
|
Self.updateUser = async(ctx, id, name, nickname, email, lang, twoFactor) => {
|
||||||
await Self.userSecurity(ctx, id);
|
await Self.userSecurity(ctx, id);
|
||||||
await Self.upsertWithWhere({id}, {name, nickname, email, lang});
|
await Self.upsertWithWhere({id}, {name, nickname, email, lang, twoFactor});
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
|
@ -101,9 +101,10 @@ module.exports = function(Self) {
|
||||||
const headers = httpRequest.headers;
|
const headers = httpRequest.headers;
|
||||||
const origin = headers.origin;
|
const origin = headers.origin;
|
||||||
|
|
||||||
const defaultHash = '/reset-password?access_token=$token$';
|
const defaultHash = '!/reset-password?access_token=$token$';
|
||||||
const recoverHashes = {
|
const recoverHashes = {
|
||||||
hedera: 'verificationToken=$token$'
|
hedera: '!verificationToken=$token$',
|
||||||
|
lilium: '/resetPassword?access_token=$token$'
|
||||||
};
|
};
|
||||||
|
|
||||||
const app = info.options?.app;
|
const app = info.options?.app;
|
||||||
|
@ -115,7 +116,7 @@ module.exports = function(Self) {
|
||||||
const params = {
|
const params = {
|
||||||
recipient: info.email,
|
recipient: info.email,
|
||||||
lang: user.lang,
|
lang: user.lang,
|
||||||
url: origin + '/#!' + recoverHash
|
url: origin + '/#' + recoverHash
|
||||||
};
|
};
|
||||||
|
|
||||||
const options = Object.assign({}, info.options);
|
const options = Object.assign({}, info.options);
|
||||||
|
|
Loading…
Reference in New Issue