module Trestle::Auth::Controller::Authentication

Protected Instance Methods

authenticate_user() click to toggle source
# File lib/trestle/auth/controller/authentication.rb, line 30
def authenticate_user
  authentication_backend.authenticate
end
authentication_backend() click to toggle source
# File lib/trestle/auth/controller/authentication.rb, line 18
def authentication_backend
  @_authentication_backend ||= Trestle.config.auth.backend.new(controller: self, request: request, session: session, cookies: cookies)
end
authentication_scope() click to toggle source
# File lib/trestle/auth/controller/authentication.rb, line 52
def authentication_scope
  authentication_backend.scope
end
current_user() click to toggle source
# File lib/trestle/auth/controller/authentication.rb, line 22
def current_user
  authentication_backend.user
end
logged_in?() click to toggle source
# File lib/trestle/auth/controller/authentication.rb, line 26
def logged_in?
  authentication_backend.logged_in?
end
login!(user) click to toggle source
# File lib/trestle/auth/controller/authentication.rb, line 38
def login!(user)
  authentication_backend.login!(user)
end
login_required!() click to toggle source
# File lib/trestle/auth/controller/authentication.rb, line 46
def login_required!
  authentication_backend.store_location(request.fullpath)
  redirect_to instance_exec(&Trestle.config.auth.login_url)
  false
end
logout!() click to toggle source
# File lib/trestle/auth/controller/authentication.rb, line 42
def logout!
  authentication_backend.logout!
end
require_authenticated_user() click to toggle source
# File lib/trestle/auth/controller/authentication.rb, line 34
def require_authenticated_user
  logged_in? || login_required!
end