// NewJWTUnaryInterceptor add users claims to outgoing context
NewJWTUnaryInterceptor add users claims to outgoing context
// NewJWTUnaryInterceptor add users claims to outgoing context
func NewJWTUnaryInterceptor(ctx context.Context, ks *jose.JSONWebKeySet, token string) (context.Context, error) {
	c, _ := NewConfig()
	claims, err := VerifyToken(token, c.Issuer, c.Audience, ks)
	if err != nil {
		return nil, status.Error(codes.Unauthenticated, "Unable to verify User")
	}
	ui := userinfo.FromClaims(claims)
	if ui.ID != "" {
		ctx = metadata.AppendToOutgoingContext(ctx, id, ui.ID, email, ui.Email)
	}
	return userinfo.WithClaims(ctx, claims), nil
}
func NewJWTUnaryInterceptor ( ctx context . Context , ks * jose . JSONWebKeySet , token string ) ( context . Context , error ) { c , _ := NewConfig ( ) claims , err := VerifyToken ( token , c . Issuer , c . Audience , ks ) if err != nil { return nil , status . Error ( codes . Unauthenticated , " " ) } ui := userinfo . FromClaims ( claims ) if ui . ID != " " { ctx = metadata . AppendToOutgoingContext ( ctx , id , ui . ID , email , ui . Email ) } return userinfo . WithClaims ( ctx , claims ) , nil }
NewJWTUnaryInterceptor add users claims to outgoing context
NewJWTUnaryInterceptor add users claims to outgoing context