12345678910111213141516171819202122232425 |
- package graphql
- import (
- "context"
- "github.com/gshopify/service-wrapper/auth"
- "gshopper.com/gshopify/customer/graphql/generated"
- "gshopper.com/gshopify/customer/model"
- )
- func (r *queryResolver) Customer(ctx context.Context, t string) (*generated.Customer, error) {
- var (
- claims *model.Claims
- err error
- )
- if _, claims, err = r.decodeAccessToken(ctx, t); err != nil {
- return nil, err
- }
- if _, err = auth.SessionManager().Token(ctx, claims.SessionId); err != nil {
- return nil, err
- }
- return r.customer(ctx, claims.Sub)
- }
|