nextauthjs / next-auth

Authentication for the Web.
https://authjs.dev
ISC License
25.04k stars 3.54k forks source link

SignIn callback parameters are wrong in documentation #12116

Open AndreiBadescu opened 1 month ago

AndreiBadescu commented 1 month ago

What is the improvement or update you wish to see?

callbacks: { async signIn({ profile }) { // Only allow sign in for users with email addresses ending with "yourdomain.com" return profile?.email?.endsWith("@yourdomain.com") }

This code from documentation is not working.

It should either be:

signIn(profile) or signIn({ user, account, profile, email, credentials })

Is there any context that might help us understand?

Should be clear enough.

Does the docs page already exist? Please link to it.

https://authjs.dev/reference/sveltekit/types#signin

halvaradop commented 1 month ago

The current documentation on the signIn callback is accurate. This method enables you to add an extra verification step to determine whether a user can access your application. For example, you could use it to confirm that the user’s email is a corporate email provided by your organization.

C-VB commented 2 hours ago

@halvaradop Andrei is talking about the curly braces around profile. The functionality works but the syntax in the code example is simply incorrect.