can't get user language in i18n.ts
Unanswered
Gharial posted this in #help-forum
GharialOP
I have i18n working successfully, but now we are using a user locale from our backend api.
I tweaked the next-auth session callback to add the language, and can see it in the
However, in
Does anyone know if I have done anything wrong or forgot to do something? How can I get the language from my user object into the result for
I tweaked the next-auth session callback to add the language, and can see it in the
/api/auth/session
endpointHowever, in
src/i18n.ts
, when I call const session = await getServerSession()
, all I see is the user's email and nothing else. Does anyone know if I have done anything wrong or forgot to do something? How can I get the language from my user object into the result for
getServerSession()
?1 Reply
GharialOP
I've added these callbacks like here https://github.com/nextauthjs/next-auth/discussions/8966