mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-01 11:35:55 +01:00
breaking: remove socket.io/flags.js
refactor: helpers.loginUser returns a single object {jar, csrf_token}
This commit is contained in:
@@ -187,14 +187,12 @@ describe('authentication', () => {
|
||||
});
|
||||
|
||||
it('should regenerate the session identifier on successful login', async () => {
|
||||
const login = util.promisify(helpers.loginUser);
|
||||
const logout = util.promisify(helpers.logoutUser);
|
||||
const matchRegexp = /express\.sid=s%3A(.+?);/;
|
||||
const { hostname, path } = url.parse(nconf.get('url'));
|
||||
|
||||
const sid = String(jar._jar.store.idx[hostname][path]['express.sid']).match(matchRegexp)[1];
|
||||
await logout(jar);
|
||||
const newJar = await login('regular', 'regularpwd');
|
||||
await helpers.logoutUser(jar);
|
||||
const newJar = (await helpers.loginUser('regular', 'regularpwd')).jar;
|
||||
const newSid = String(newJar._jar.store.idx[hostname][path]['express.sid']).match(matchRegexp)[1];
|
||||
|
||||
assert.notStrictEqual(newSid, sid);
|
||||
|
||||
Reference in New Issue
Block a user