jorge-menjivar / unsaged

Open source chat kit engineered for seamless interaction with AI models.

Home Page:https://unsaged.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Infinite redirect loop after google login

diegosc78 opened this issue · comments

I've followed the 7 steps in readme, mapping a /etc/host dns name for the application and using it in .env.local

  • Application loads OK
  • Google authentication finishes OK (no errors after login, row in next_auth schema tables, browser redirects)
  • Browser redirects to http://thedomainiveconfigured:3000/es
  • Infinite redirect loop

Any clue?

Hmm, it looks like an issue with language configuration. It seems like it is trying to go to the Spanish version of the site, which isn't there. I will need to look into it a bit more.

Thank you very much. I changed browser language preferences to english and it worked. I'll dig a bit to guess how to extend or configure your code for adding new languages or jumping to a default language if it doesn't find browser one. Thanks again

The project was previously using https://github.com/i18next/next-i18next to support multiple languages. However they do not support the new NextJS app dir so it had to be dropped.

Going forward it would probably be best to stick with the default NextJS implementation documented here https://nextjs.org/docs/app/building-your-application/routing/internationalization or a tool built on top of that

I can confirm this issue on other languages. My friend had this issue, changing browser language to English fixed it. (Firefox and Chrome tested)