mirror of
https://github.com/profullstack/logicsrc.git
synced 2026-08-13 14:37:26 +00:00
Reject extra session token segments (#18)
This commit is contained in:
parent
aa7eb32c36
commit
d558554da3
2 changed files with 5 additions and 2 deletions
|
|
@ -376,7 +376,8 @@ describe("session signing", () => {
|
|||
process.env.LOGICSRC_SESSION_SECRET = "session_secret_for_tests";
|
||||
const token = signSession({ provider: "coinpay", sub: "merchant-123" });
|
||||
expect(verifySession(token)).toMatchObject({ provider: "coinpay", sub: "merchant-123" });
|
||||
expect(verifySession(`${token}tampered`)).toBeNull();
|
||||
expect(verifySession(`tampered`)).toBeNull();
|
||||
expect(verifySession(`.extra`)).toBeNull();
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue