Fix: skip Turnstile when no token provided (IP access before DNS)
This commit is contained in:
parent
29772fa1e4
commit
de5ad23763
|
|
@ -66,8 +66,8 @@ func (h *AdminHandler) AdminLogin(c *gin.Context) {
|
|||
}
|
||||
req.Email = strings.ToLower(strings.TrimSpace(req.Email))
|
||||
|
||||
// Verify Turnstile token (invisible mode)
|
||||
if h.turnstileSecret != "" {
|
||||
// Verify Turnstile token (invisible mode) — only if both secret and token are present
|
||||
if h.turnstileSecret != "" && req.TurnstileToken != "" {
|
||||
turnstileService := services.NewTurnstileService(h.turnstileSecret)
|
||||
remoteIP := c.ClientIP()
|
||||
turnstileResp, err := turnstileService.VerifyToken(req.TurnstileToken, remoteIP)
|
||||
|
|
|
|||
Loading…
Reference in a new issue