Skip to content

Commit

Permalink
Add missing type to encodeJwt
Browse files Browse the repository at this point in the history
  • Loading branch information
freekh committed Aug 29, 2023
1 parent 3051084 commit d0e5904
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/smooth-kangaroos-leave.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@valbuild/server": patch
---

Add missing type to encodeJwt
2 changes: 1 addition & 1 deletion packages/server/src/jwt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ const jwtHeaderBase64 = Buffer.from(JSON.stringify(jwtHeader)).toString(
"base64"
);

export function encodeJwt(payload: object, sessionKey: string): string {
export function encodeJwt(payload: JwtPayload, sessionKey: string): string {
// NOTE: this is only used for authentication, not for authorization (i.e. what a user can do) - this is handled when actually doing operations
const payloadBase64 = Buffer.from(JSON.stringify(payload)).toString("base64");
return `${jwtHeaderBase64}.${payloadBase64}.${crypto
Expand Down

0 comments on commit d0e5904

Please sign in to comment.