-
Notifications
You must be signed in to change notification settings - Fork 4k
Description
What is the improvement or update you wish to see?
It looks like the redirectTo
path in the signIn
method has to start with a forward slash. I accidentally passed a value without a slash (e.g. dashboard
instead of /dashboard
) which causes a fatal error in next.js.
The error messages shown to the developer are ambiguous. Either next.js reports an error in the LoginButton UI component which calls await signIn("microsoft-entra-id", { redirectTo });
or there is a "bad configuration" error page. There is no helpful stacktrace that could lead a developer to the issue.
A server error in the runtime that is caused by a string value is really hard to debug. Please add a check and a helpful error message for the signIn method.
Is there any context that might help us understand?
I spent way too long debugging a weird login issue that was caused by a relative path as a fallback value to redirectTo.
Does the docs page already exist? Please link to it.
I haven't found it, but the error should be shown in the Error.message and the error page.