workos / authkit-nextjs

The WorkOS library for Next.js provides convenient helpers for authentication and session management using WorkOS & AuthKit with Next.js.
MIT License
67 stars 18 forks source link

Only try to parse state if it's available #106

Closed PaulAsjes closed 1 month ago

PaulAsjes commented 1 month ago

Fixes https://github.com/workos/authkit-nextjs/issues/96

We always assumed that state would be set in the callback URI, however that's not the case with invitations. This adds a safety check before trying to parse.