We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bb810db commit 8a233d5Copy full SHA for 8a233d5
middlewares/auth.go
@@ -97,6 +97,11 @@ func Authenticate(c *fiber.Ctx) error {
97
path = strings.Split(path, "?")[0]
98
if isAuthNeeded(path) {
99
headers := c.GetReqHeaders()
100
+ if len(headers["Authorization"]) == 0 {
101
+ return c.Status(fiber.StatusUnauthorized).JSON(fiber.Map{
102
+ "message": "Unauthorized",
103
+ })
104
+ }
105
tokenString, err := extractToken(headers["Authorization"][0])
106
if err != nil || tokenString == "" {
107
tokenString = c.Query("authorization")
0 commit comments