We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9170ca6 commit 67b3cf7Copy full SHA for 67b3cf7
1 file changed
middleware.go
@@ -58,10 +58,16 @@ func middlewareWithConfig(config Config) fiber.Handler {
58
}
59
if err != nil && strings.ToLower(err.Error()) == "token is expired" {
60
return c.Status(http.StatusUnauthorized).
61
- JSON(fiber.Map{"message": err.Error()})
+ JSON(fiber.Map{
62
+ "code": http.StatusUnauthorized,
63
+ "message": err.Error(),
64
+ })
65
66
return c.Status(http.StatusForbidden).
- JSON(fiber.Map{"message": http.StatusText(http.StatusForbidden)})
67
68
+ "code": http.StatusForbidden,
69
+ "message": http.StatusText(http.StatusForbidden),
70
71
72
73
0 commit comments