mirror of
https://github.com/labstack/echo.git
synced 2025-06-15 00:14:57 +02:00
Flexible handler and middleware
Signed-off-by: Vishal Rana <vr@labstack.com>
This commit is contained in:
@ -10,10 +10,10 @@ import (
|
||||
)
|
||||
|
||||
type (
|
||||
BasicAuthFunc func(usr, pwd string) bool
|
||||
BasicAuthFunc func(string, string) bool
|
||||
AuthorizedHandler bolt.HandlerFunc
|
||||
UnauthorizedHandler func(c *bolt.Context, err error)
|
||||
JwtKeyFunc func(kid string) ([]byte, error)
|
||||
UnauthorizedHandler func(*bolt.Context, error)
|
||||
JwtKeyFunc func(string) ([]byte, error)
|
||||
Claims map[string]interface{}
|
||||
)
|
||||
|
||||
@ -57,7 +57,7 @@ func JwtAuth(ah AuthorizedHandler, uah UnauthorizedHandler, fn JwtKeyFunc) bolt.
|
||||
if t.Valid {
|
||||
c.Set("claims", Claims(t.Claims))
|
||||
ah(c)
|
||||
c.Next()
|
||||
// c.Next()
|
||||
} else {
|
||||
// TODO: capture errors
|
||||
uah(c, err)
|
||||
|
Reference in New Issue
Block a user