2024-01-16 16:13:06 +00:00
|
|
|
package claim
|
|
|
|
|
|
|
|
import (
|
|
|
|
"git.gocasts.ir/ebhomengo/niki/config"
|
2024-01-25 11:43:39 +00:00
|
|
|
authservice "git.gocasts.ir/ebhomengo/niki/service/auth"
|
2024-01-16 16:13:06 +00:00
|
|
|
"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)
|
|
|
|
}
|