generated from VLADIMIR/template
19 lines
424 B
Go
19 lines
424 B
Go
package app
|
|
|
|
import (
|
|
"context"
|
|
|
|
"evening_detective_server/internal/modules/processor_jwt"
|
|
|
|
"google.golang.org/grpc/codes"
|
|
"google.golang.org/grpc/status"
|
|
)
|
|
|
|
func claimsFromContext(ctx context.Context) (*processor_jwt.JWTClaims, error) {
|
|
claims, ok := processor_jwt.ClaimsFromContext(ctx)
|
|
if !ok {
|
|
return nil, status.Error(codes.Unauthenticated, "требуется авторизация")
|
|
}
|
|
return claims, nil
|
|
}
|