From eee482197c5282a3086663166d1f0b2840a25998 Mon Sep 17 00:00:00 2001 From: chan Date: Wed, 11 Feb 2026 14:23:20 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=EC=84=B8=EC=85=98=20=ED=86=A0=ED=81=B0?= =?UTF-8?q?=20=ED=95=84=EB=93=9C=EB=AA=85=20=EB=B6=88=EC=9D=BC=EC=B9=98=20?= =?UTF-8?q?=EB=B0=8F=20URL=20=ED=8C=8C=EC=8B=B1=20=EC=98=A4=EB=A5=98(auth?= =?UTF-8?q?=5Fhandler)=20=EC=88=98=EC=A0=95=20#239?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/internal/handler/auth_handler.go | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/backend/internal/handler/auth_handler.go b/backend/internal/handler/auth_handler.go index a960d7df..d32b1f00 100644 --- a/backend/internal/handler/auth_handler.go +++ b/backend/internal/handler/auth_handler.go @@ -1594,12 +1594,12 @@ func (h *AuthHandler) PasswordLogin(c *fiber.Ctx) error { // --- OIDC 로그인 흐름 처리 끝 --- resp := fiber.Map{ - "sessionJwt": authInfo.SessionToken.JWT, - "status": "ok", - "provider": h.IdpProvider.Name(), + "sessionToken": authInfo.SessionToken.JWT, + "status": "ok", + "provider": h.IdpProvider.Name(), } if authInfo.RefreshToken != nil { - resp["refreshJwt"] = authInfo.RefreshToken.JWT + resp["refreshToken"] = authInfo.RefreshToken.JWT } if authInfo.Subject != "" { resp["subject"] = authInfo.Subject @@ -4789,10 +4789,7 @@ func extractLoginIDFromClaims(claims map[string]any) string { } func (h *AuthHandler) getKratosIdentity(sessionToken string) (string, map[string]interface{}, error) { - kratosURL := strings.TrimRight(os.Getenv("KRATOS_PUBLIC_URL"), "/") - if kratosURL == "" { - kratosURL = "http://kratos:4433" - } + kratosURL := strings.TrimRight(utils.GetEnv("KRATOS_PUBLIC_URL", "http://kratos:4433"), "/") req, err := http.NewRequestWithContext(context.Background(), http.MethodGet, kratosURL+"/sessions/whoami", nil) if err != nil { return "", nil, err @@ -4823,10 +4820,7 @@ func (h *AuthHandler) getKratosIdentity(sessionToken string) (string, map[string } func (h *AuthHandler) getKratosSessionID(sessionToken string) (string, error) { - kratosURL := strings.TrimRight(os.Getenv("KRATOS_PUBLIC_URL"), "/") - if kratosURL == "" { - kratosURL = "http://kratos:4433" - } + kratosURL := strings.TrimRight(utils.GetEnv("KRATOS_PUBLIC_URL", "http://kratos:4433"), "/") req, err := http.NewRequestWithContext(context.Background(), http.MethodGet, kratosURL+"/sessions/whoami", nil) if err != nil { return "", err @@ -4849,6 +4843,7 @@ func (h *AuthHandler) getKratosSessionID(sessionToken string) (string, error) { if err := json.NewDecoder(resp.Body).Decode(&result); err != nil { return "", err } + return result.ID, nil } @@ -4857,10 +4852,7 @@ func (h *AuthHandler) issueKratosSession(ctx context.Context, identityID string) return "", fmt.Errorf("kratos identity id is empty") } - kratosAdminURL := strings.TrimRight(os.Getenv("KRATOS_ADMIN_URL"), "/") - if kratosAdminURL == "" { - kratosAdminURL = "http://kratos:4434" - } + kratosAdminURL := strings.TrimRight(utils.GetEnv("KRATOS_ADMIN_URL", "http://kratos:4434"), "/") payload := map[string]interface{}{ "identity_id": identityID,