From 11e8b30122c501ad92ec90be1f5713e8da194749 Mon Sep 17 00:00:00 2001 From: Patrick Britton Date: Mon, 16 Feb 2026 23:33:31 -0600 Subject: [PATCH] fix: resolve variable naming conflict in ALTCHA challenge handlers --- go-backend/internal/handlers/admin_handler.go | 6 +++--- go-backend/internal/handlers/auth_handler.go | 6 +++--- sojorn_app/.gitignore | 1 + 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/go-backend/internal/handlers/admin_handler.go b/go-backend/internal/handlers/admin_handler.go index c8459f7..8aaa116 100644 --- a/go-backend/internal/handlers/admin_handler.go +++ b/go-backend/internal/handlers/admin_handler.go @@ -4140,9 +4140,9 @@ func (h *AdminHandler) GetAltchaChallenge(c *gin.Context) { challenge := fmt.Sprintf("%x", sha256.Sum256([]byte(salt)))[:10] // Create HMAC signature using JWT secret as the key - h := hmac.New(sha256.New, []byte(h.jwtSecret)) - h.Write([]byte(challenge + salt)) - signature := hex.EncodeToString(h.Sum(nil)) + mac := hmac.New(sha256.New, []byte(h.jwtSecret)) + mac.Write([]byte(challenge + salt)) + signature := hex.EncodeToString(mac.Sum(nil)) response := map[string]interface{}{ "algorithm": "SHA-256", diff --git a/go-backend/internal/handlers/auth_handler.go b/go-backend/internal/handlers/auth_handler.go index fc9878b..b8598b8 100644 --- a/go-backend/internal/handlers/auth_handler.go +++ b/go-backend/internal/handlers/auth_handler.go @@ -606,9 +606,9 @@ func (h *AuthHandler) GetAltchaChallenge(c *gin.Context) { challenge := fmt.Sprintf("%x", sha256.Sum256([]byte(salt)))[:10] // Create HMAC signature using JWT secret as the key - h := hmac.New(sha256.New, []byte(h.config.JWTSecret)) - h.Write([]byte(challenge + salt)) - signature := hex.EncodeToString(h.Sum(nil)) + mac := hmac.New(sha256.New, []byte(h.config.JWTSecret)) + mac.Write([]byte(challenge + salt)) + signature := hex.EncodeToString(mac.Sum(nil)) response := map[string]interface{}{ "algorithm": "SHA-256", diff --git a/sojorn_app/.gitignore b/sojorn_app/.gitignore index 3820a95..d45aaa2 100644 --- a/sojorn_app/.gitignore +++ b/sojorn_app/.gitignore @@ -1,4 +1,5 @@ # Miscellaneous +*.sql *.class *.log *.pyc