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

13 lines
387 B
Go
Raw Permalink Normal View History

package claim
import (
"git.gocasts.ir/ebhomengo/niki/config"
authservice "git.gocasts.ir/ebhomengo/niki/service/auth"
"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)
}