diff --git a/backend/internal/handler/auth_handler.go b/backend/internal/handler/auth_handler.go index 3a6adbd1..0cb9f0a8 100644 --- a/backend/internal/handler/auth_handler.go +++ b/backend/internal/handler/auth_handler.go @@ -4005,11 +4005,10 @@ func (h *AuthHandler) resolveCurrentProfile(c *fiber.Ctx) (*domain.UserProfileRe if token != "" { profile, err = h.getKratosProfile(token) if err != nil && h.Hydra != nil { - // Fallback to Hydra introspection - slog.Debug("Kratos session check failed, trying Hydra", "error", err) + // Fallback to Hydra introspection. This is expected for API calls using Bearer tokens. + slog.Debug("Kratos cookie session absent, falling back to Hydra token", "error", err.Error()) profile, err = h.getHydraProfile(c.Context(), token) - } - } else if cookie != "" { + } } else if cookie != "" { profile, err = h.getKratosProfileWithCookie(cookie) } }