1
0
forked from baron/baron-sso

로그인 페이지 및 기능 구현

This commit is contained in:
2026-01-26 14:21:44 +09:00
parent 3725eac1a8
commit 4919cb2f8b
10 changed files with 715 additions and 1 deletions

View File

@@ -97,6 +97,11 @@ func (h *AuthHandler) CheckEmail(c *fiber.Ctx) error {
return c.Status(fiber.StatusBadRequest).JSON(fiber.Map{"error": "Invalid request"})
}
// Email Format Validation
if !strings.Contains(req.Email, "@") || !strings.Contains(req.Email, ".") {
return c.Status(fiber.StatusBadRequest).JSON(fiber.Map{"error": "Invalid email format"})
}
if h.DescopeClient == nil {
return c.Status(fiber.StatusServiceUnavailable).JSON(fiber.Map{"error": "Identity provider unavailable"})
}
@@ -366,7 +371,7 @@ func (h *AuthHandler) Signup(c *fiber.Ctx) error {
slog.Error("[Signup] Failed to set password", "error", err)
// Rollback? Delete user?
h.DescopeClient.Management.User().Delete(context.Background(), req.Email)
return c.Status(fiber.StatusInternalServerError).JSON(fiber.Map{"error": "Failed to set password"})
return c.Status(fiber.StatusInternalServerError).JSON(fiber.Map{"error": fmt.Sprintf("Failed to set password: %v", err)})
}
// 4. Cleanup Redis