Class: Mutations::Auth::ValidateToken

Inherits:
GraphQL::Schema::Mutation
  • Object
show all
Defined in:
app/graphql/mutations/auth/validate_token.rb

Instance Method Summary collapse

Instance Method Details

#resolveObject



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'app/graphql/mutations/auth/validate_token.rb', line 9

def resolve
  user = context[:current_user]

  if user.present? && !user.access_locked?
    {
      errors: [],
      success: true,
      user: user,
      valid: true
    }
  else
    {
      errors: [],
      success: false,
      user: nil,
      valid: false
    }
  end
end