mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-02-27 17:11:14 +01:00
fix: failure on session reroll 🍣 test
This commit is contained in:
@@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
|
|
||||||
const assert = require('assert');
|
const assert = require('assert');
|
||||||
|
const url = require('url');
|
||||||
const async = require('async');
|
const async = require('async');
|
||||||
const nconf = require('nconf');
|
const nconf = require('nconf');
|
||||||
const request = require('request');
|
const request = require('request');
|
||||||
@@ -228,11 +229,12 @@ describe('authentication', () => {
|
|||||||
const login = util.promisify(helpers.loginUser);
|
const login = util.promisify(helpers.loginUser);
|
||||||
const logout = util.promisify(helpers.logoutUser);
|
const logout = util.promisify(helpers.logoutUser);
|
||||||
const matchRegexp = /express\.sid=s%3A(.+?);/;
|
const matchRegexp = /express\.sid=s%3A(.+?);/;
|
||||||
|
const { hostname, path } = url.parse(nconf.get('url'));
|
||||||
|
|
||||||
const sid = String(jar._jar.store.idx.localhost['/']['express.sid']).match(matchRegexp)[1];
|
const sid = String(jar._jar.store.idx[hostname][path]['express.sid']).match(matchRegexp)[1];
|
||||||
await logout(jar);
|
await logout(jar);
|
||||||
const newJar = await login('regular', 'regularpwd');
|
const newJar = await login('regular', 'regularpwd');
|
||||||
const newSid = String(newJar._jar.store.idx.localhost['/']['express.sid']).match(matchRegexp)[1];
|
const newSid = String(newJar._jar.store.idx[hostname][path]['express.sid']).match(matchRegexp)[1];
|
||||||
|
|
||||||
assert.notStrictEqual(newSid, sid);
|
assert.notStrictEqual(newSid, sid);
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user