mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-03-06 12:31:33 +01:00
test: another test fix
This commit is contained in:
@@ -140,11 +140,11 @@ describe('authentication', () => {
|
|||||||
|
|
||||||
it('should regenerate the session identifier on successful login', async () => {
|
it('should regenerate the session identifier on successful login', async () => {
|
||||||
const matchRegexp = /express\.sid=s%3A(.+?);/;
|
const matchRegexp = /express\.sid=s%3A(.+?);/;
|
||||||
const { hostname, path } = new URL(nconf.get('url'));
|
const { hostname, pathname } = new URL(nconf.get('url'));
|
||||||
const sid = String(jar.store.idx[hostname][path]['express.sid']).match(matchRegexp)[1];
|
const sid = String(jar.store.idx[hostname][pathname]['express.sid']).match(matchRegexp)[1];
|
||||||
await helpers.logoutUser(jar);
|
await helpers.logoutUser(jar);
|
||||||
const newJar = (await helpers.loginUser('regular', 'regularpwd')).jar;
|
const newJar = (await helpers.loginUser('regular', 'regularpwd')).jar;
|
||||||
const newSid = String(newJar.store.idx[hostname][path]['express.sid']).match(matchRegexp)[1];
|
const newSid = String(newJar.store.idx[hostname][pathname]['express.sid']).match(matchRegexp)[1];
|
||||||
|
|
||||||
assert.notStrictEqual(newSid, sid);
|
assert.notStrictEqual(newSid, sid);
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user