Next.js Discord

Discord Forum

can't get user language in i18n.ts

Unanswered
Gharial posted this in #help-forum
Open in Discord
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 /api/auth/session endpoint

However, 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