Class: StandardId::Web::VerifyPhone::ConfirmController
- Inherits:
-
BaseController
- Object
- ApplicationController
- BaseController
- BaseController
- StandardId::Web::VerifyPhone::ConfirmController
- Defined in:
- app/controllers/standard_id/web/verify_phone/confirm_controller.rb
Constant Summary
Constants included from RateLimitHandling
RateLimitHandling::RATE_LIMIT_STORE
Instance Method Summary collapse
Methods included from StandardId::WebAuthentication
#current_account, #current_scope_names, #current_session, #revoke_current_session!
Methods included from ControllerPolicy
all_controllers, authenticated_controllers, public_controllers, register, registry_snapshot, reset_registry!
Instance Method Details
#show ⇒ Object
7 8 9 10 |
# File 'app/controllers/standard_id/web/verify_phone/confirm_controller.rb', line 7 def show return redirect_to(standard_id_web.login_path, alert: "Invalid or expired verification code") if @challenge.nil? render plain: "verify phone confirm", status: :ok end |
#update ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 |
# File 'app/controllers/standard_id/web/verify_phone/confirm_controller.rb', line 12 def update return redirect_to(standard_id_web.login_path, alert: "Invalid or expired verification code") if @challenge.nil? identifier = StandardId::PhoneNumberIdentifier.find_by(value: @challenge.target) if identifier.present? identifier.verify! end @challenge.use! redirect_to standard_id_web.login_path, notice: "Your phone number has been verified. Please sign in.", status: :see_other end |