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
43 stars 9 forks source link

Throw error on URI mismatch #49

Closed PaulAsjes closed 1 month ago

PaulAsjes commented 1 month ago

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

In the case where you have:

You'd get stuck in a login loop as you'd be redirected to AuthKit before the session can be set establishing that you've already logged in.

This adds a check and throws an error in that case.