0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-17 23:44:39 -05:00

Renamed passwordreset body object to password_reset

refs https://github.com/TryGhost/Toolbox/issues/308

- I've just renamed the endpoint to `password_reset` but we might as
  well change the body object to make the change in v5 too
This commit is contained in:
Daniel Lockyer 2022-04-25 16:14:58 +01:00
parent 5aa5770791
commit 1068070bd2
3 changed files with 6 additions and 6 deletions

View file

@ -52,10 +52,10 @@ export default Controller.extend(ValidationEngine, {
try {
let resp = yield this.ajax.put(authUrl, {
data: {
passwordreset: [credentials]
password_reset: [credentials]
}
});
this.notifications.showAlert(resp.passwordreset[0].message, {type: 'warn', delayed: true, key: 'password.reset'});
this.notifications.showAlert(resp.password_reset[0].message, {type: 'warn', delayed: true, key: 'password.reset'});
this.session.authenticate('authenticator:cookie', this.email, credentials.newPassword);
return true;
} catch (error) {

View file

@ -123,7 +123,7 @@ export default class SigninController extends Controller.extend(ValidationEngine
try {
yield this.validate({property: 'forgotPassword'});
yield this.ajax.post(forgottenUrl, {data: {passwordreset: [{email}]}});
yield this.ajax.post(forgottenUrl, {data: {password_reset: [{email}]}});
notifications.showAlert(
'Please check your email for instructions.',
{type: 'info', key: 'forgot-password.send.success'}

View file

@ -10,8 +10,8 @@ export default function mockAuthentication(server) {
});
server.post('/authentication/password_reset', function (schema, request) {
let {passwordreset} = JSON.parse(request.requestBody);
let email = passwordreset[0].email;
let {password_reset} = JSON.parse(request.requestBody);
let email = password_reset[0].email;
if (email === 'unknown@example.com') {
return new Response(404, {}, {
@ -24,7 +24,7 @@ export default function mockAuthentication(server) {
});
} else {
return {
passwordreset: [
password_reset: [
{message: 'Check your email for further instructions.'}
]
};