From dee9ce2f64b8026c0dc4ed53c5e325bd5c702679 Mon Sep 17 00:00:00 2001 From: AmirMahdi Qiasvand Date: Sun, 7 Sep 2025 16:46:59 +0330 Subject: [PATCH] ref: authenticate handler --- internal/api/http/handlers/auth_handler.go | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/internal/api/http/handlers/auth_handler.go b/internal/api/http/handlers/auth_handler.go index dfbbccb..347409b 100644 --- a/internal/api/http/handlers/auth_handler.go +++ b/internal/api/http/handlers/auth_handler.go @@ -58,14 +58,12 @@ func (h *AuthHandler) Authenticate(c *fiber.Ctx) error { } challenge := &domain.Challenge{ - Message: messageUUID, + Message: messageUUID, + //TODO: fetch from cache TimeStamp: time.Now().UTC(), ExpiresAt: time.Now().Add(5 * time.Minute), } - clientIP := c.IP() - userAgent := c.Get("User-Agent") - userToken, err := h.authService.Authenticate( c.Context(), req.PubKey, @@ -73,8 +71,8 @@ func (h *AuthHandler) Authenticate(c *fiber.Ctx) error { challenge, // add chainID to cfg 1, - clientIP, - userAgent, + c.IP(), + c.Get("User-Agent"), ) if err != nil { return c.Status(fiber.StatusUnauthorized).JSON(fiber.Map{