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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user