1
0
forked from baron/baron-sso

fix(backend): resolve signup issues by fixing tenant slug case-sensitivity and exposing Kratos errors

This commit is contained in:
2026-03-27 20:03:50 +09:00
parent 987b4797bb
commit 603b9e0032
2 changed files with 6 additions and 2 deletions

View File

@@ -473,6 +473,8 @@ func (h *AuthHandler) Signup(c *fiber.Ctx) error {
normalizedPhone = "+" + normalizedPhone
}
slog.Info("[Signup] Phone normalization", "raw", req.Phone, "normalized", normalizedPhone)
// IDP에 전달할 BrokerUser 스키마 구성
attributes := map[string]interface{}{
"department": req.Department,
@@ -517,7 +519,8 @@ func (h *AuthHandler) Signup(c *fiber.Ctx) error {
if strings.Contains(err.Error(), "already exists") {
return errorJSON(c, fiber.StatusConflict, "User already exists")
}
return errorJSON(c, fiber.StatusInternalServerError, "Failed to create user")
// Include the actual error message in the response for debugging
return errorJSON(c, fiber.StatusInternalServerError, fmt.Sprintf("Failed to create user: %v", err))
}
// 4. Cleanup Redis