Initial chaos

This commit is contained in:
2022-09-23 21:37:00 +02:00
parent 510dc87cb3
commit 4f8d553923
22 changed files with 772 additions and 1 deletions

View File

@@ -0,0 +1,18 @@
package middleware
import (
"twitch-clone/pkg/jwt"
"github.com/gofiber/fiber/v2"
)
/*CheckToken : Check the validate of the jwt*/
func CheckToken(c *fiber.Ctx) error {
_, _, _, err := jwt.ProcessJWT(c.Get("Authorization"))
if err != nil {
return err
}
c.Next()
return nil
}