forked from baron/baron-sso
린트 적용
This commit is contained in:
@@ -312,10 +312,18 @@ func (h *AuthHandler) Signup(c *fiber.Ctx) error {
|
|||||||
}
|
}
|
||||||
// Check complexity (at least 2 types: lower, upper, digit, special)
|
// Check complexity (at least 2 types: lower, upper, digit, special)
|
||||||
types := 0
|
types := 0
|
||||||
if strings.ContainsAny(req.Password, "abcdefghijklmnopqrstuvwxyz") { types++ }
|
if strings.ContainsAny(req.Password, "abcdefghijklmnopqrstuvwxyz") {
|
||||||
if strings.ContainsAny(req.Password, "ABCDEFGHIJKLMNOPQRSTUVWXYZ") { types++ }
|
types++
|
||||||
if strings.ContainsAny(req.Password, "0123456789") { types++ }
|
}
|
||||||
if strings.ContainsAny(req.Password, "!@#$%^&*()_+-=[]{}|;:,.<>?") { types++ }
|
if strings.ContainsAny(req.Password, "ABCDEFGHIJKLMNOPQRSTUVWXYZ") {
|
||||||
|
types++
|
||||||
|
}
|
||||||
|
if strings.ContainsAny(req.Password, "0123456789") {
|
||||||
|
types++
|
||||||
|
}
|
||||||
|
if strings.ContainsAny(req.Password, "!@#$%^&*()_+-=[]{}|;:,.<>?") {
|
||||||
|
types++
|
||||||
|
}
|
||||||
if types < 2 {
|
if types < 2 {
|
||||||
return c.Status(fiber.StatusBadRequest).JSON(fiber.Map{"error": "Password must contain at least 2 types of characters (letters, numbers, symbols)"})
|
return c.Status(fiber.StatusBadRequest).JSON(fiber.Map{"error": "Password must contain at least 2 types of characters (letters, numbers, symbols)"})
|
||||||
}
|
}
|
||||||
@@ -1305,8 +1313,6 @@ func (h *AuthHandler) HandleDescopeEmailRelay(c *fiber.Ctx) error {
|
|||||||
return c.Status(501).JSON(fiber.Map{"error": "Real email sending not implemented"})
|
return c.Status(501).JSON(fiber.Map{"error": "Real email sending not implemented"})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// --- User Profile Handlers ---
|
// --- User Profile Handlers ---
|
||||||
|
|
||||||
func (h *AuthHandler) formatPhoneForDisplay(phone string) string {
|
func (h *AuthHandler) formatPhoneForDisplay(phone string) string {
|
||||||
|
|||||||
@@ -68,7 +68,6 @@ func NewAuditLogEntry(c *fiber.Ctx, stage string) *AuditLogEntry {
|
|||||||
headers["Origin"] = c.Get("Origin")
|
headers["Origin"] = c.Get("Origin")
|
||||||
headers["Referer"] = c.Get("Referer")
|
headers["Referer"] = c.Get("Referer")
|
||||||
|
|
||||||
|
|
||||||
return &AuditLogEntry{
|
return &AuditLogEntry{
|
||||||
RequestID: reqID,
|
RequestID: reqID,
|
||||||
Stage: stage,
|
Stage: stage,
|
||||||
@@ -85,7 +84,6 @@ func NewAuditLogEntry(c *fiber.Ctx, stage string) *AuditLogEntry {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Log emits an audit log entry using slog.
|
// Log emits an audit log entry using slog.
|
||||||
// It includes common fields and allows for additional custom fields.
|
// It includes common fields and allows for additional custom fields.
|
||||||
func (ale *AuditLogEntry) Log(level slog.Level, msg string, args ...any) {
|
func (ale *AuditLogEntry) Log(level slog.Level, msg string, args ...any) {
|
||||||
|
|||||||
Reference in New Issue
Block a user