From 06dde1410850198ed3fe0437a176fb95388b1da4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E0=A4=95=E0=A4=BE=E0=A4=B0=E0=A4=A4=E0=A5=8B=E0=A4=AB?= =?UTF-8?q?=E0=A5=8D=E0=A4=AB=E0=A5=87=E0=A4=B2=E0=A4=B8=E0=A5=8D=E0=A4=95?= =?UTF-8?q?=E0=A5=8D=E0=A4=B0=E0=A4=BF=E0=A4=AA=E0=A5=8D=E0=A4=9F=E2=84=A2?= Date: Wed, 24 Apr 2024 18:07:35 +0200 Subject: [PATCH] add additional assertion that the browserId hash is the same on the new token --- packages/cli/test/unit/auth/auth.service.test.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/cli/test/unit/auth/auth.service.test.ts b/packages/cli/test/unit/auth/auth.service.test.ts index 6ff58f97b84ed..60fdd121266db 100644 --- a/packages/cli/test/unit/auth/auth.service.test.ts +++ b/packages/cli/test/unit/auth/auth.service.test.ts @@ -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 () => {