Enable JWT Auth
All checks were successful
Create Release & Upload Assets / Upload Assets To Gitea w/ goreleaser (push) Successful in 2m30s
All checks were successful
Create Release & Upload Assets / Upload Assets To Gitea w/ goreleaser (push) Successful in 2m30s
This commit is contained in:
@@ -4,6 +4,7 @@ import (
|
||||
fifo "github.com/foize/go.fifo"
|
||||
sentryecho "github.com/getsentry/sentry-go/echo"
|
||||
"github.com/golang-jwt/jwt/v5"
|
||||
"github.com/labstack/echo-jwt/v4"
|
||||
"github.com/labstack/echo/v4"
|
||||
"github.com/labstack/echo/v4/middleware"
|
||||
"golang.org/x/time/rate"
|
||||
@@ -84,17 +85,15 @@ func StartEcho(server chan bool, webserver_addr string, webserver_port int) {
|
||||
api_v1 := e.Group("/api/v1")
|
||||
|
||||
// Echo JWT - Won't accept valid keys? Bug To-Do
|
||||
/*
|
||||
api_v1.Use(echojwt.WithConfig(echojwt.Config{
|
||||
SigningKey: []byte(config.JWT_Secret),
|
||||
SigningMethod: "HS256",
|
||||
TokenLookup: "header:Authorization:Bearer ,query:token, param:token",
|
||||
ContextKey: "User",
|
||||
NewClaimsFunc: func(c echo.Context) jwt.Claims {
|
||||
return new(jwtCustomClaims)
|
||||
},
|
||||
}))
|
||||
*/
|
||||
api_v1.Use(echojwt.WithConfig(echojwt.Config{
|
||||
SigningKey: []byte(config.JWT_Secret),
|
||||
SigningMethod: "HS256",
|
||||
TokenLookup: "header:Authorization:Bearer ,query:token, param:token",
|
||||
ContextKey: "User",
|
||||
NewClaimsFunc: func(c echo.Context) jwt.Claims {
|
||||
return new(jwtCustomClaims)
|
||||
},
|
||||
}))
|
||||
|
||||
api_v1.POST("/print", func(c echo.Context) error {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user