Class: Composable::Pwdless::AuthController
- Inherits:
-
BaseController
- Object
- BaseController
- Composable::Pwdless::AuthController
- Defined in:
- app/controllers/composable/pwdless/auth_controller.rb
Instance Method Summary collapse
Methods inherited from BaseController
Instance Method Details
#create ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 |
# File 'app/controllers/composable/pwdless/auth_controller.rb', line 8 def create @form = Form::Authentication.call(authentication_params) if @form.success? deliver_authentication(@form) @form = @form.result block_given? ? yield(@form) : render(:edit) else render :new, status: :unprocessable_entity end end |
#new ⇒ Object
4 5 6 |
# File 'app/controllers/composable/pwdless/auth_controller.rb', line 4 def new @form = Form::Authentication.new end |
#update ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'app/controllers/composable/pwdless/auth_controller.rb', line 20 def update @form = Form::Verification.call(verification_params) if @form.success? verification_succeeded @form.data elsif @form.has_expired? verification_expired @form elsif @form.has_exceeded_attempts? verification_exceeded_attempts @form elsif @form.invalid_code? render :edit, status: :unprocessable_entity else verification_failed @form end end |