Class: Hello::Authentication::SudoModeController
- Inherits:
-
Hello::ApplicationController
- Object
- ApplicationController
- Hello::ApplicationController
- Hello::Authentication::SudoModeController
- Defined in:
- app/controllers/hello/authentication/sudo_mode_controller.rb
Instance Method Summary collapse
-
#authenticate ⇒ Object
PATCH /hello/sudo_mode.
-
#expire ⇒ Object
GET /hello/sudo_mode/expire.
-
#form ⇒ Object
GET /hello/sudo_mode.
Instance Method Details
#authenticate ⇒ Object
PATCH /hello/sudo_mode
12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'app/controllers/hello/authentication/sudo_mode_controller.rb', line 12 def authenticate business = Business::Authentication::SudoModeAuthentication.new(current_access) if business.authenticate!(password_param) path_to_go = session[:url] || root_path flash[:notice] = business. redirect_to path_to_go else flash.now[:alert] = business. render_sudo_mode_form end end |
#expire ⇒ Object
GET /hello/sudo_mode/expire
26 27 28 29 30 31 |
# File 'app/controllers/hello/authentication/sudo_mode_controller.rb', line 26 def expire business = Business::Authentication::SudoModeExpiration.new(current_access) business.expire! flash[:notice] = business. redirect_to '/' end |
#form ⇒ Object
GET /hello/sudo_mode
7 8 9 |
# File 'app/controllers/hello/authentication/sudo_mode_controller.rb', line 7 def form render_sudo_mode_form end |