From 5939bdb8d7c98eeb558a094c5c92c1f828fc080f Mon Sep 17 00:00:00 2001 From: LeonG11 Date: Thu, 7 May 2026 11:53:03 +0300 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=20.env=20=D1=84=D0=B0=D0=B9=D0=BB=20=D0=B4=D0=BB=D1=8F?= =?UTF-8?q?=20=D0=B0=D0=B2=D1=82=D0=BE=D1=80=D0=B8=D0=B7=D0=B0=D1=86=D0=B8?= =?UTF-8?q?=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Изменена структра проекта, добавлен .env файл, вынесен импорт через godotenv --- backend/handlers/auth_handler.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/backend/handlers/auth_handler.go b/backend/handlers/auth_handler.go index 087b644..265655c 100644 --- a/backend/handlers/auth_handler.go +++ b/backend/handlers/auth_handler.go @@ -2,8 +2,8 @@ package handlers import ( "net/http" - "time" "os" + "time" "github.com/gin-gonic/gin" "github.com/golang-jwt/jwt/v5" @@ -13,10 +13,8 @@ import ( "viplight-mrp/models" ) -jwtSecret := os.Getenv("JWT_SECRET") -jwtKey := []byte(jwtSecret) - func Login(c *gin.Context) { + jwtKey := []byte(os.Getenv("JWT_SECRET")) var input struct { Username string `json:"username"` Password string `json:"password"`