Injected the username when password has changed. (#3033)
* Injected the username when password has changed. When the resetPassword controller has successfully updated the user's password, it now redirects the user to the password changed page with the username as a query parameters. * Update unit test for password_reset_success redirect
This commit is contained in:
committed by
Florent Vilmart
parent
bb9ce773bb
commit
9abf17730f
@@ -816,7 +816,7 @@ describe("Custom Pages, Email Verification, Password Reset", () => {
|
||||
return;
|
||||
}
|
||||
expect(response.statusCode).toEqual(302);
|
||||
expect(response.body).toEqual('Found. Redirecting to http://localhost:8378/1/apps/password_reset_success.html');
|
||||
expect(response.body).toEqual('Found. Redirecting to http://localhost:8378/1/apps/password_reset_success.html?username=zxcv');
|
||||
|
||||
Parse.User.logIn("zxcv", "hello").then(function(user){
|
||||
let config = new Config('test');
|
||||
|
||||
@@ -102,9 +102,10 @@ export class PublicAPIRouter extends PromiseRouter {
|
||||
}
|
||||
|
||||
return config.userController.updatePassword(username, token, new_password).then((result) => {
|
||||
let params = qs.stringify({username: username});
|
||||
return Promise.resolve({
|
||||
status: 302,
|
||||
location: config.passwordResetSuccessURL
|
||||
location: `${config.passwordResetSuccessURL}?${params}`
|
||||
});
|
||||
}, (err) => {
|
||||
let params = qs.stringify({username: username, token: token, id: config.applicationId, error:err, app:config.appName})
|
||||
|
||||
Reference in New Issue
Block a user