Skip to content

Commit

Permalink
add additional assertion that the browserId hash is the same on the n…
Browse files Browse the repository at this point in the history
…ew token
  • Loading branch information
netroy committed Apr 24, 2024
1 parent 4ef2d82 commit 06dde14
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/cli/test/unit/auth/auth.service.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,9 @@ describe('AuthService', () => {
const newToken = res.cookie.mock.calls[0].at(1);
expect(newToken).not.toBe(validToken);
expect(await authService.resolveJwt(newToken, req, res)).toEqual(user);
expect((jwt.decode(newToken) as jwt.JwtPayload).browserId).toEqual(
(jwt.decode(validToken) as jwt.JwtPayload).browserId,
);
});

it('should refresh the cookie only if less than 1/4th of time is left', async () => {
Expand Down

0 comments on commit 06dde14

Please sign in to comment.