module Wallaby::AuthenticationConcern

Authentication related functions

Public Instance Methods

authenticate_user!() click to toggle source

(see authenticate_user!) TODO: remove this from 6.2

Calls superclass method
# File lib/concerns/wallaby/authentication_concern.rb, line 112
def authenticate_user!
  authenticated =
    if security.authenticate? || !defined? super
      instance_exec(&security.authenticate)
    else
      Logger.deprecated 'Wallaby will use `authenticate_wallaby_user!`' \
        'instead of `authenticate_user!` from 6.2.'
      super
    end
  raise NotAuthenticated if authenticated == false

  true
end
authenticate_wallaby_user!() click to toggle source

(see authenticate_wallaby_user!)

# File lib/concerns/wallaby/authentication_concern.rb, line 144
def authenticate_wallaby_user!
  authenticated = try :authenticate_user!
  raise NotAuthenticated if authenticated == false

  true
end
current_user() click to toggle source

(see current_user) TODO: remove this from 6.2

Calls superclass method
# File lib/concerns/wallaby/authentication_concern.rb, line 100
def current_user
  @current_user ||=
    if security.current_user? || !defined? super
      instance_exec(&security.current_user)
    else
      Logger.deprecated 'Wallaby will use `wallaby_user` instead of `current_user` from 6.2.'
      super
    end
end
forbidden(exception = nil) click to toggle source

(see forbidden)

# File lib/concerns/wallaby/authentication_concern.rb, line 157
def forbidden(exception = nil)
  render_error exception, __callee__
end
override_pundit_user() click to toggle source

(see override_pundit_user)

# File lib/concerns/wallaby/authentication_concern.rb, line 133
def override_pundit_user
  wallaby_user
end
unauthorized(exception = nil) click to toggle source

(see unauthorized)

# File lib/concerns/wallaby/authentication_concern.rb, line 152
def unauthorized(exception = nil)
  render_error exception, __callee__
end
wallaby_user() click to toggle source

(see wallaby_user)

# File lib/concerns/wallaby/authentication_concern.rb, line 127
def wallaby_user
  @wallaby_user ||= try :current_user
end