endpoint to update JWT cookies

This commit is contained in:
Daniel Goc
2026-03-18 15:40:54 +01:00
parent 01c8f4333f
commit e094865fc7
7 changed files with 167 additions and 30 deletions

View File

@@ -408,9 +408,12 @@ func (h *AuthHandler) GoogleCallback(c fiber.Ctx) error {
// Redirect to the locale-prefixed charts page after successful Google login.
// The user's preferred language is stored in the auth response; fall back to "en".
lang := response.User.Lang
if lang == "" {
lang = "en"
lang, err := h.authService.GetLangISOCode(response.User.LangID)
if err != nil {
return c.Status(responseErrors.GetErrorStatus(responseErrors.ErrBadLangID)).JSON(fiber.Map{
"error": responseErrors.GetErrorCode(c, responseErrors.ErrBadLangID),
})
}
return c.Redirect().To(h.config.App.BaseURL + "/" + lang)
}