Replies: 2 comments
-
You may need to override the session callback. By default, the session contains only a few properties, others like the id must be forwarded manually in that callback. The callbacks would go in your authOptions object, see here. |
Beta Was this translation helpful? Give feedback.
-
Hi, I have been digging into this issue for a while. For me, nextauth seems not to recognize the same user and try to create a new account each time logging in. Later on, I found out the ID is not present in the profile object. All I found to identify the user is using
AuthentikProvider({
clientId: config.auth.autho.id,
clientSecret: config.auth.autho.secret,
issuer: config.auth.autho.issuer,
profile(profile) {
return {
...profile,
id: profile.sub,
}
}
}) I am not quite familiar with oidc and Oauth. If anyone knows a better solution please hit me. |
Beta Was this translation helpful? Give feedback.
-
Hello! I am creating dashboard app in next js utilizing app directory and am unable to determine why id is not present in session object provided by getServerSession function.
I am using next@13.4.12 and next-auth@4.22.3.
I would expect that calling this api route logs profile structure presented here: url from authentik provider documentation, however id is missing.
Middleware just exports default next-auth middleware.
Beta Was this translation helpful? Give feedback.
All reactions