Properly querystring encode the parameters
This commit is contained in:
@@ -4,6 +4,7 @@ import Config from '../Config';
|
|||||||
import express from 'express';
|
import express from 'express';
|
||||||
import path from 'path';
|
import path from 'path';
|
||||||
import fs from 'fs';
|
import fs from 'fs';
|
||||||
|
import qs from 'querystring';
|
||||||
|
|
||||||
let public_html = path.resolve(__dirname, "../../public_html");
|
let public_html = path.resolve(__dirname, "../../public_html");
|
||||||
let views = path.resolve(__dirname, '../../views');
|
let views = path.resolve(__dirname, '../../views');
|
||||||
@@ -25,9 +26,10 @@ export class PublicAPIRouter extends PromiseRouter {
|
|||||||
|
|
||||||
let userController = config.userController;
|
let userController = config.userController;
|
||||||
return userController.verifyEmail(username, token).then( () => {
|
return userController.verifyEmail(username, token).then( () => {
|
||||||
|
let params = qs.stringify({username});
|
||||||
return Promise.resolve({
|
return Promise.resolve({
|
||||||
status: 302,
|
status: 302,
|
||||||
location: `${config.verifyEmailSuccessURL}?username=${username}`
|
location: `${config.verifyEmailSuccessURL}?${params}`
|
||||||
});
|
});
|
||||||
}, ()=> {
|
}, ()=> {
|
||||||
return this.invalidLink(req);
|
return this.invalidLink(req);
|
||||||
@@ -71,9 +73,10 @@ export class PublicAPIRouter extends PromiseRouter {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return config.userController.checkResetTokenValidity(username, token).then( (user) => {
|
return config.userController.checkResetTokenValidity(username, token).then( (user) => {
|
||||||
|
let params = qs.stringify({token, id: config.applicationId, username, app: config.appName, });
|
||||||
return Promise.resolve({
|
return Promise.resolve({
|
||||||
status: 302,
|
status: 302,
|
||||||
location: `${config.choosePasswordURL}?token=${token}&id=${config.applicationId}&username=${username}&app=${config.appName}`
|
location: `${config.choosePasswordURL}?${params}`
|
||||||
})
|
})
|
||||||
}, () => {
|
}, () => {
|
||||||
return this.invalidLink(req);
|
return this.invalidLink(req);
|
||||||
@@ -104,9 +107,10 @@ export class PublicAPIRouter extends PromiseRouter {
|
|||||||
location: config.passwordResetSuccessURL
|
location: config.passwordResetSuccessURL
|
||||||
});
|
});
|
||||||
}, (err) => {
|
}, (err) => {
|
||||||
|
let params = qs.stringify({username: username, token: token, id: config.applicationId, error:err, app:config.appName})
|
||||||
return Promise.resolve({
|
return Promise.resolve({
|
||||||
status: 302,
|
status: 302,
|
||||||
location: `${config.choosePasswordURL}?token=${token}&id=${config.applicationId}&username=${username}&error=${err}&app=${config.appName}`
|
location: `${config.choosePasswordURL}?${params}`
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user