diff options
Diffstat (limited to '')
| -rw-r--r-- | backend/api/auth.go (renamed from backend/middleware/auth.go) | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/backend/middleware/auth.go b/backend/api/auth.go index e2c84fa..91ef80c 100644 --- a/backend/middleware/auth.go +++ b/backend/api/auth.go | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | package middleware | 1 | package api |
| 2 | 2 | ||
| 3 | import ( | 3 | import ( |
| 4 | "fmt" | 4 | "fmt" |
| @@ -16,7 +16,7 @@ func CheckAuth(c *gin.Context) { | |||
| 16 | // Validate token | 16 | // Validate token |
| 17 | token, err := jwt.Parse(tokenString, func(token *jwt.Token) (interface{}, error) { | 17 | token, err := jwt.Parse(tokenString, func(token *jwt.Token) (interface{}, error) { |
| 18 | if _, ok := token.Method.(*jwt.SigningMethodHMAC); !ok { | 18 | if _, ok := token.Method.(*jwt.SigningMethodHMAC); !ok { |
| 19 | return nil, fmt.Errorf("Unexpected signing method: %v", token.Header["alg"]) | 19 | return nil, fmt.Errorf("unexpected signing method: %v", token.Header["alg"]) |
| 20 | } | 20 | } |
| 21 | return []byte(os.Getenv("SECRET_KEY")), nil | 21 | return []byte(os.Getenv("SECRET_KEY")), nil |
| 22 | }) | 22 | }) |