zod icon indicating copy to clipboard operation
zod copied to clipboard

Add string jwt

Open danilomourelle opened this issue 2 years ago • 4 comments

Add a .jwt() validator in string type.

It expects for a string with 3 parts splited by . with the first part being a base64 encoded string that represents a objetc wit a property type with value JWT.

It validates just format NOT signature.

Resolves #2946

danilomourelle avatar Aug 18 '23 13:08 danilomourelle

Deploy Preview for guileless-rolypoly-866f8a ready!

Name Link
Latest commit 00ba486136e2230fdc4139d9c3f6df2c1b48b5b4
Latest deploy log https://app.netlify.com/sites/guileless-rolypoly-866f8a/deploys/662842d236cd16000958338b
Deploy Preview https://deploy-preview-2666--guileless-rolypoly-866f8a.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

netlify[bot] avatar Aug 18 '23 13:08 netlify[bot]

Just a reminder that you left some console.logs in the code

hudson-bruno avatar Aug 24 '23 22:08 hudson-bruno

Ooopss... thanks man, already removed.

danilomourelle avatar Aug 29 '23 19:08 danilomourelle

Why wasn't this PR merged yet? It will be very useful for my use case! Does it need some improvements?

nikelborm avatar Jan 26 '24 08:01 nikelborm

Hey guys, anything else I should do to it be accept?

danilomourelle avatar Apr 11 '24 13:04 danilomourelle

Hello @colinhacks

I believe this PR are good to go. Let me know if need anything else.

danilomourelle avatar Apr 18 '24 15:04 danilomourelle

Thanks, this is excellent stuff! Apologies for the long turnaround time. I'm hesitant to merge features like this into Zod 3 for bundle size reasons. Zod 4 will have better tree shaking characteristics so I'm merging this into the v4 branch. Some version of this will land in Zod 4, but (as a heads up) it may be a while, and this feature/API will likely undergo some changes in the interim.

colinhacks avatar Apr 23 '24 23:04 colinhacks