fix(auth): keep subsystem oauth working without sso

This commit is contained in:
mac
2026-07-16 16:43:01 +08:00
parent cafa8bc840
commit 2835cf2576
3 changed files with 16 additions and 1 deletions
+3
View File
@@ -56,6 +56,9 @@ func (h *OAuthHandler) Authorize(c *gin.Context) {
user, ok := h.sessionUser(c)
if !ok {
loginURL := "/auth/api/v1/login/internal-sso?relay_state=" + url.QueryEscape(c.Request.URL.RequestURI())
if !h.cfg.SSOEnabled {
loginURL = "/login?redirect=" + url.QueryEscape(c.Request.URL.RequestURI())
}
c.Redirect(http.StatusFound, loginURL)
return
}