mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-27 22:49:56 -05:00
🐛 Fixed "Access Denied" error when accepting staff invite
ref https://app.incident.io/ghost/incidents/117 - the authenticate call made as part of signup was missed as part of the update when we adjusted the params for `cookie` authenticator's `authenticate` method in Admin so it could switch behaviour for 2fa - fixed the authenticate call params and updated our mocked `/session` endpoint to check for expected POST data which would have let tests catch this error
This commit is contained in:
parent
28a9a431db
commit
856dd1fc2b
2 changed files with 7 additions and 2 deletions
|
@ -104,6 +104,6 @@ export default class SignupController extends Controller {
|
||||||
const {email, password} = this.signupDetails;
|
const {email, password} = this.signupDetails;
|
||||||
|
|
||||||
return this.session
|
return this.session
|
||||||
.authenticate('authenticator:cookie', email, password);
|
.authenticate('authenticator:cookie', {identification: email, password});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,7 +5,12 @@ import {isBlank} from '@ember/utils';
|
||||||
|
|
||||||
export default function mockAuthentication(server) {
|
export default function mockAuthentication(server) {
|
||||||
// Password sign-in
|
// Password sign-in
|
||||||
server.post('/session', function () {
|
server.post('/session', function (schema, request) {
|
||||||
|
const data = JSON.parse(request.requestBody);
|
||||||
|
if (!data.username || !data.password) {
|
||||||
|
return new Response(401);
|
||||||
|
}
|
||||||
|
|
||||||
return new Response(201);
|
return new Response(201);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue