Sha256: 92535e958652b2dabe1ff6596099008b07b4604514b4ec4e88c83742ef4c0176

Contents?: true

Size: 356 Bytes

Versions: 17

Compression:

Stored size: 356 Bytes

Contents

# frozen_string_literal: true

module Ibrain::Auth::Mutations
  class SignOutMutation < BaseMutation
    field :result, Boolean, null: true

    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
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
ibrain-auth-0.3.7 app/graphql/ibrain/auth/mutations/sign_out_mutation.rb
ibrain-auth-0.3.6 app/graphql/ibrain/auth/mutations/sign_out_mutation.rb
ibrain-auth-0.3.5 app/graphql/ibrain/auth/mutations/sign_out_mutation.rb
ibrain-auth-0.3.4 app/graphql/ibrain/auth/mutations/sign_out_mutation.rb
ibrain-auth-0.3.3 app/graphql/ibrain/auth/mutations/sign_out_mutation.rb
ibrain-auth-0.3.2 app/graphql/ibrain/auth/mutations/sign_out_mutation.rb
ibrain-auth-0.3.1 app/graphql/ibrain/auth/mutations/sign_out_mutation.rb
ibrain-auth-0.2.9 app/graphql/ibrain/auth/mutations/sign_out_mutation.rb
ibrain-auth-0.2.8 app/graphql/ibrain/auth/mutations/sign_out_mutation.rb
ibrain-auth-0.2.7 app/graphql/ibrain/auth/mutations/sign_out_mutation.rb
ibrain-auth-0.2.6 app/graphql/ibrain/auth/mutations/sign_out_mutation.rb
ibrain-auth-0.2.5 app/graphql/ibrain/auth/mutations/sign_out_mutation.rb
ibrain-auth-0.2.4 app/graphql/ibrain/auth/mutations/sign_out_mutation.rb
ibrain-auth-0.2.3 app/graphql/ibrain/auth/mutations/sign_out_mutation.rb
ibrain-auth-0.2.2 app/graphql/ibrain/auth/mutations/sign_out_mutation.rb
ibrain-auth-0.2.1 app/graphql/ibrain/auth/mutations/sign_out_mutation.rb
ibrain-auth-0.2.0 app/graphql/ibrain/auth/mutations/sign_out_mutation.rb