Skip to content

Commit

Permalink
fix: change sign in schema to accept siwe message object instead of s…
Browse files Browse the repository at this point in the history
…tring
  • Loading branch information
aj-may committed Jan 11, 2023
1 parent 5d8751c commit 14d23c7
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,23 @@ declare module "iron-session" {
}
}

const siweMessageSchema = z.object({
domain: z.string(),
address: z.string(),
statement: z.string().optional(),
uri: z.string(),
version: z.string(),
chainId: z.number(),
nonce: z.string(),
issuedAt: z.string().optional(),
expirationTime: z.string().optional(),
notBefore: z.string().optional(),
requestId: z.string().optional(),
resources: z.array(z.string()).optional(),
});

export const signInRequestSchema = z.object({
message: z.string(),
message: siweMessageSchema,
signature: z.string(),
});

Expand Down

0 comments on commit 14d23c7

Please sign in to comment.