Sha256: 04b12a689e7b10630cf88c39c3411f357fc5ed80d0ed9c919582ec48dc7eb733

Contents?: true

Size: 484 Bytes

Versions: 16

Compression:

Stored size: 484 Bytes

Contents

module GraphqlDevise
  module Mutations
    class Logout < Base
      def resolve
        if current_resource && client && current_resource.tokens[client]
          current_resource.tokens.delete(client)
          current_resource.save!

          remove_resource

          yield current_resource if block_given?

          { authenticatable: current_resource }
        else
          raise_user_error(I18n.t('graphql_devise.user_not_found'))
        end
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
graphql_devise-0.12.3 lib/graphql_devise/mutations/logout.rb
graphql_devise-0.12.2 lib/graphql_devise/mutations/logout.rb
graphql_devise-0.12.1 lib/graphql_devise/mutations/logout.rb
graphql_devise-0.12.0 lib/graphql_devise/mutations/logout.rb
graphql_devise-0.11.4 lib/graphql_devise/mutations/logout.rb
graphql_devise-0.11.3 lib/graphql_devise/mutations/logout.rb
graphql_devise-0.11.2 lib/graphql_devise/mutations/logout.rb
graphql_devise-0.11.1 lib/graphql_devise/mutations/logout.rb
graphql_devise-0.11.0 lib/graphql_devise/mutations/logout.rb
graphql_devise-0.10.1 app/graphql/graphql_devise/mutations/logout.rb
graphql_devise-0.10.0 app/graphql/graphql_devise/mutations/logout.rb
graphql_devise-0.9.2 app/graphql/graphql_devise/mutations/logout.rb
graphql_devise-0.9.1 app/graphql/graphql_devise/mutations/logout.rb
graphql_devise-0.9.0 app/graphql/graphql_devise/mutations/logout.rb
graphql_devise-0.8.1 app/graphql/graphql_devise/mutations/logout.rb
graphql_devise-0.8.0 app/graphql/graphql_devise/mutations/logout.rb