forked from ebhomengo/niki
1
0
Fork 0
niki/pkg/claim/echo.go

13 lines
398 B
Go

package claim
import (
"git.gocasts.ir/ebhomengo/niki/config"
authservice "git.gocasts.ir/ebhomengo/niki/service/auth/benefactor"
"github.com/labstack/echo/v4"
)
func GetClaimsFromEchoContext(c echo.Context) *authservice.Claims {
//nolint:forcetypeassert //defensive programming vs let it crash - log-metric-recover ,...
return c.Get(config.AuthMiddlewareContextKey).(*authservice.Claims)
}