class SSO::Server::Warden::Hooks::BeforeLogout

Attributes

options[R]
user[R]
warden[R]

Public Class Methods

new(user:, warden:, options:) click to toggle source
# File lib/sso/server/warden/hooks/before_logout.rb, line 24
def initialize(user:, warden:, options:)
  @user, @warden, @options = user, warden, options
end
to_proc() click to toggle source
# File lib/sso/server/warden/hooks/before_logout.rb, line 13
def self.to_proc
  proc do |user, warden, options|
    begin
      new(user: user, warden: warden, options: options).call
    rescue => exception
      ::SSO.config.exception_handler.call exception
      nil
    end
  end
end

Public Instance Methods

call() click to toggle source
# File lib/sso/server/warden/hooks/before_logout.rb, line 28
def call
  debug { 'Before warden destroys the passport in the cookie, it will revoke all connected Passports as well.' }
  revoking = Passports.logout passport_id: params['passport_id']

  error { 'Could not revoke the Passports.' } if revoking.failure?
  debug { 'Finished.' }
  nil
end