next-auth profile object prop in signIn callback function
Unanswered
Spectacled bear posted this in #help-forum
Spectacled bearOP
in next-auth options callbacks field, we have a function named signIn which is triggered right after a client tries signing in, i wanted to know what exactly is the profile field and how it is created? This profile object is present as one of the props of signIn callback function.
async signIn({ account, user, credentials, email, profile }) 4 Replies
@Spectacled bear I believe that is the profile returned by an OAuth provider. https://github.com/nextauthjs/next-auth/blob/3245c02eac456d4b1a0bd2dc897f4e41644018b2/packages/core/src/lib/routes/callback.ts#L168C55-L168C67
@andrewscofield <@843499106625650700> I believe that is the profile returned by an OAuth provider. https://github.com/nextauthjs/next-auth/blob/3245c02eac456d4b1a0bd2dc897f4e41644018b2/packages/core/src/lib/routes/callback.ts#L168C55-L168C67
Spectacled bearOP
got it, basically both account and profile are related to oauth in some way and fields are intermingled to construct both objects
thanks
Yep, and the data varies provider to provider