update kontor-fiber to use Go Fiber v3
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 4s
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 4s
This commit is contained in:
@@ -5,12 +5,12 @@ import (
|
||||
"kontor-api-fiber/pkg/schema"
|
||||
"kontor-api-fiber/pkg/utils"
|
||||
|
||||
"github.com/gofiber/fiber/v2"
|
||||
"github.com/gofiber/fiber/v3"
|
||||
"github.com/golang-jwt/jwt/v5"
|
||||
"github.com/uptrace/bun"
|
||||
)
|
||||
|
||||
func Login(c *fiber.Ctx) error {
|
||||
func Login(c fiber.Ctx) error {
|
||||
user := c.FormValue("user")
|
||||
pass := c.FormValue("pass")
|
||||
|
||||
@@ -39,7 +39,7 @@ func Login(c *fiber.Ctx) error {
|
||||
return c.JSON(fiber.Map{"token": token})
|
||||
}
|
||||
|
||||
func Restricted(c *fiber.Ctx) error {
|
||||
func Restricted(c fiber.Ctx) error {
|
||||
user := c.Locals("user").(*jwt.Token)
|
||||
claims := user.Claims.(jwt.MapClaims)
|
||||
name := claims["name"].(string)
|
||||
|
||||
Reference in New Issue
Block a user