Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
small fix
  • Loading branch information
xil222 committed Aug 13, 2021
commit 72f20d56b3b7adff7730fa2ba9e6be775ee8c069
6 changes: 4 additions & 2 deletions test/unit/auth/auth.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3597,10 +3597,11 @@ AUTH_CONFIGS.forEach((testConfig) => {

it('verifyIdToken() should reject user disabled before ID tokens revoked', () => {
// One second before validSince.
const oneSecBeforeValidSince = Math.floor(validSince.getTime() / 1000 - 1);
const expectedAccountInfoResponseUserDisabled = Object.assign({}, expectedAccountInfoResponse);
expectedAccountInfoResponseUserDisabled.users[0].disabled = true;
const expectedUserRecordDisabled = getValidUserRecord(expectedAccountInfoResponseUserDisabled);
const validSince = new Date(expectedUserRecordDisabled.tokensValidAfterTime!);
const oneSecBeforeValidSince = Math.floor(validSince.getTime() / 1000 - 1);
const getUserStub = sinon.stub(testConfig.Auth.prototype, 'getUser')
.resolves(expectedUserRecordDisabled);
expect(expectedUserRecordDisabled.disabled).to.be.equal(true);
Expand Down Expand Up @@ -3660,10 +3661,11 @@ AUTH_CONFIGS.forEach((testConfig) => {

it('verifySessionCookie() should reject user disabled before ID tokens revoked', () => {
// One second before validSince.
const oneSecBeforeValidSince = Math.floor(validSince.getTime() / 1000 - 1);
const expectedAccountInfoResponseUserDisabled = Object.assign({}, expectedAccountInfoResponse);
expectedAccountInfoResponseUserDisabled.users[0].disabled = true;
const expectedUserRecordDisabled = getValidUserRecord(expectedAccountInfoResponseUserDisabled);
const validSince = new Date(expectedUserRecordDisabled.tokensValidAfterTime!);
const oneSecBeforeValidSince = Math.floor(validSince.getTime() / 1000 - 1);
const getUserStub = sinon.stub(testConfig.Auth.prototype, 'getUser')
.resolves(expectedUserRecordDisabled);
expect(expectedUserRecordDisabled.disabled).to.be.equal(true);
Expand Down