-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Custom Sign-in Page #10547
Comments
Having the same problem. No key "authorisation" is present on the providers object. Not possible to create any custom sign in page for now. |
i seems like the
|
Thanks for pointing out the If there's still an issue with the provider authorization overrides then please open a new issue about that 🙏 |
@mmiszy I gave the linked page another look over, and that's a mistake on our part int he custom sign-in page example. This is a bit of a hacky workaround which should work if you're importing the whole import { signIn, config } from "@/auth.ts"
const slugify = (text: string) => text.toLowerCase().replace(/ /g, "-")
export default async function SignInPage() {
return (
<div className="flex flex-col gap-4 max-w-80 mx-auto justify-center h-screen">
{Object.values(config.providers).map((provider) => (
<form
action={async () => {
"use server"
await signIn(slugify(provider.name))
}}
>
<Button className="flex flex-row gap-2" type="submit">
<span>Sign in with {provider.name}</span>
</Button>
</form>
))}
</div>
)
} We'll update the page shortly as well 👍 |
What is the improvement or update you wish to see?
The Custom Sign-in Page mentions
provider.authorisation.url
should be used as form action. Unfortunately, that doesn't seem to be working and results in the error:Moreover, when
/api/auth/signin/${provider.id}
is used as the form action,MissingCSRF
error is thrown on submission.Is there any context that might help us understand?
—
Does the docs page already exist? Please link to it.
https://authjs.dev/guides/pages/signin
The text was updated successfully, but these errors were encountered: