Open abhijitgujar86 opened 4 years ago
@abhijitgujar86 good idea I will do a video with the change
@abhijitgujar86
For the auth function
func auth() fiber.Handler {
return jwtware.New(jwtware.Config{
ErrorHandler: func(ctx *fiber.Ctx, err error) error {
return ctx.Status(fiber.StatusUnauthorized).JSON(fiber.Map{
"error": "Unauthorized",
})
},
SigningKey: []byte(JwtSecretKey),
})
}
if you can't figure what you should place, your IDE can help you with the types
Fiber have moved to v2 . there are many breaking changes . I think it will be good to have updated examples. adn this will help all.
github.com/gofiber/fiber/v2