refs #5979 fix(vn-user): resetPassword url
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Alex Moreno 2023-11-13 12:26:31 +01:00
parent bfaa648280
commit 1a66987cd0
1 changed files with 6 additions and 2 deletions

View File

@ -92,7 +92,11 @@ module.exports = function(Self) {
};
Self.on('resetPasswordRequest', async function(info) {
const url = await Self.app.models.Url.getUrl();
const loopBackContext = LoopBackContext.getCurrentContext();
const httpCtx = {req: loopBackContext.active};
const httpRequest = httpCtx.req.http.req;
const headers = httpRequest.headers;
const origin = headers.origin;
const defaultHash = '/reset-password?access_token=$token$';
const recoverHashes = {
@ -108,7 +112,7 @@ module.exports = function(Self) {
const params = {
recipient: info.email,
lang: user.lang,
url: url.slice(0, -1) + recoverHash
url: origin + '/#!' + recoverHash
};
const options = Object.assign({}, info.options);