Sha256: 89ccfd2ac4cddcf7545b8501136966608c6c0ed99297884b01bc14b01149a679
Contents?: true
Size: 639 Bytes
Versions: 10
Compression:
Stored size: 639 Bytes
Contents
class ApplicationController < ActionController::Base before_action :set_current_request_details before_action :authenticate <%- if options.sudoable? %> def require_sudo unless Current.session.sudo? redirect_to new_sessions_sudo_path(proceed_to_url: request.url) end end <%- end -%> private def authenticate if session = Session.find_by_id(cookies.signed[:session_token]) Current.session = session else redirect_to sign_in_path end end def set_current_request_details Current.user_agent = request.user_agent Current.ip_address = request.ip end end
Version data entries
10 entries across 10 versions & 1 rubygems