fix: pass csrf_token into calls to /register/abort, #11017

This commit is contained in:
Julian Lam
2022-11-09 13:20:28 -05:00
parent 55a197a7d7
commit 2f9d8c350e
3 changed files with 8 additions and 5 deletions

View File

@@ -1237,8 +1237,10 @@ describe('Controllers', () => {
describe('account pages', () => {
let jar;
let csrf_token;
before(async () => {
({ jar } = await helpers.loginUser('foo', 'barbar'));
({ jar, csrf_token } = await helpers.loginUser('foo', 'barbar'));
});
it('should redirect to account page with logged in user', (done) => {
@@ -1802,7 +1804,7 @@ describe('Controllers', () => {
assert.strictEqual(res.body, '/register/complete');
await requestAsync({
uri: `${nconf.get('url')}/register/abort`,
uri: `${nconf.get('url')}/register/abort?_csrf=${csrf_token}`,
method: 'post',
jar,
simple: false,