Class: Ibrain::Mutations::SignOutMutation

Inherits:
AuthMutation
  • Object
show all
Defined in:
app/graphql/ibrain/mutations/sign_out_mutation.rb

Instance Method Summary collapse

Methods inherited from AuthMutation

#_prefixes, #ready?

Instance Method Details

#resolveObject



7
8
9
10
11
12
13
14
# File 'app/graphql/ibrain/mutations/sign_out_mutation.rb', line 7

def resolve
  current_user.jti = nil
  sign_out if current_user.save

  current_user.device_tokens.delete_all unless user_signed_in?

  OpenStruct.new(result: !user_signed_in?)
end