zod icon indicating copy to clipboard operation
zod copied to clipboard

add isJWT validation

Open Sevi7 opened this issue 3 years ago • 2 comments

isJWT() can be useful for validating user tokens sent in querystring parameters in WebSocket connections

Sevi7 avatar Oct 19 '22 13:10 Sevi7

Probably best achieved with .regex()

colinhacks avatar Oct 19 '22 18:10 colinhacks

You can use .refine(value => validator.isJWT(value)) where validator comes from https://www.npmjs.com/package/validator

renatoargh avatar Nov 25 '22 21:11 renatoargh

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Feb 23 '23 22:02 stale[bot]