Skip to content

Commit

Permalink
[Auth] Update to call uuidv4 to generate jti (thirdweb-dev#1812)
Browse files Browse the repository at this point in the history
  • Loading branch information
adam-maj authored Oct 20, 2023
1 parent 5486019 commit c238fde
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/funny-eels-watch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@thirdweb-dev/auth": patch
---

Update to call uuidv4 to generate jti
5 changes: 5 additions & 0 deletions .changeset/wise-boats-perform.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@thirdweb-dev/auth": patch
---

Update to use uuidv4 for default jti
2 changes: 1 addition & 1 deletion packages/auth/src/core/schema/authenticate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export const AuthenticationPayloadDataSchema = z.object({
exp: RawDateSchema,
nbf: RawDateSchema,
iat: RawDateSchema,
jti: z.string().default(uuidv4()),
jti: z.string().default(() => uuidv4()),
ctx: JsonSchema.optional(),
});

Expand Down
2 changes: 1 addition & 1 deletion packages/auth/src/core/schema/login.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export const LoginPayloadDataSchema = z.object({
uri: z.string().optional(),
version: z.string().default("1"),
chain_id: z.string().optional(),
nonce: z.string().default(uuidv4()),
nonce: z.string().default(() => uuidv4()),
issued_at: z
.date()
.default(new Date())
Expand Down

0 comments on commit c238fde

Please sign in to comment.