Class: RailsBase::Mfa::Validate::TotpController
- Inherits:
-
RailsBaseApplicationController
- Object
- ActionController::Base
- RailsBaseApplicationController
- RailsBase::Mfa::Validate::TotpController
- Defined in:
- app/controllers/rails_base/mfa/validate/totp_controller.rb
Constant Summary
Constants included from CaptureReferenceHelper
CaptureReferenceHelper::CAPTURE_ACTION_NAME, CaptureReferenceHelper::CAPTURE_CONTROLLER_PATH, CaptureReferenceHelper::CAPTURE_REFERRED_PATH
Constants included from AppearanceHelper
AppearanceHelper::APPEARANCE_MODE_ACTUAL_COOKIE, AppearanceHelper::APPEARANCE_MODE_COOKIE, AppearanceHelper::APPEARANCE_TEXT_CLASS, AppearanceHelper::VIEWPORT_EXTRA_LARGE, AppearanceHelper::VIEWPORT_EXTRA_SMALL, AppearanceHelper::VIEWPORT_LARGE, AppearanceHelper::VIEWPORT_MEDIUM, AppearanceHelper::VIEWPORT_MOBILE_MAX, AppearanceHelper::VIEWPORT_SIZES, AppearanceHelper::VIEWPORT_SMALL
Constants included from ApplicationHelper
ApplicationHelper::TIMEZONE_OFFSET_COOKIE, ApplicationHelper::TIMEZONE_SESSION_NAME
Instance Method Summary collapse
-
#totp_event ⇒ Object
POST mfa/validate/totp/:event.
-
#totp_event_input ⇒ Object
GET mfa/validate/totp/:event.
Methods inherited from RailsBaseApplicationController
#admin_impersonation_session?, #admin_reset_impersonation_session!, #admin_user?, #capture_admin_action, #is_timeout_error?, #populate_admin_actions, #set_time_zone
Methods included from CaptureReferenceHelper
#authenticate_user!, #capture_and_clear_reference_redirect!, #capture_clear_reference_from_sesssion!, #capture_reference, #redirect_from_reference, #reference_redirect, #skip_capture_reference!, #skip_capture_reference?, #use_capture_reference?
Methods included from AppearanceHelper
#appearance_mode_drop_down, #appearance_text_class, #footer_mode_case, #force_sticky_mode!
Methods included from ApplicationHelper
#admin_reset_session!, #browser, #is_mobile?, #is_safari?, #mfa_fallback?
Instance Method Details
#totp_event ⇒ Object
POST mfa/validate/totp/:event
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'app/controllers/rails_base/mfa/validate/totp_controller.rb', line 11 def totp_event user = User.find(@__rails_base_mfa_event.user_id) mfa_validity = ::RailsBase::Mfa::Totp::ValidateCode.(user: user, otp_code: params[:totp_code]) if mfa_validity.failure? redirect_to(RailsBase.url_routes.mfa_with_event_path(mfa_event: @__rails_base_mfa_event.event, type: RailsBase::Mfa::OTP), alert: mfa_validity.) return end user.set_last_mfa_otp_login! if @__rails_base_mfa_event.sign_in_user logger.info("Logging User in") sign_in(mfa_validity.user) end if @__rails_base_mfa_event.set_satiated_on_success logger.info("Satiating MFA Event") @__rails_base_mfa_event.satiated! end add_mfa_event_to_session(event: @__rails_base_mfa_event) redirect_to @__rails_base_mfa_event.redirect, notice: @__rails_base_mfa_event.flash_notice end |
#totp_event_input ⇒ Object
GET mfa/validate/totp/:event
8 |
# File 'app/controllers/rails_base/mfa/validate/totp_controller.rb', line 8 def totp_event_input; end |