Class: Morpho::UnlocksController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- Morpho::UnlocksController
- Defined in:
- app/controllers/morpho/unlocks_controller.rb
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
6 7 8 9 10 11 12 13 14 15 |
# File 'app/controllers/morpho/unlocks_controller.rb', line 6 def create if user && user.login_locked? user.resend_unlock_token_email! flash.now[:notice] = I18n.t('morpho.messages.unlocks.unlock.success') render :new else flash.now[:error] = I18n.t('morpho.messages.unlocks.unlock.failure') render :new end end |
#show ⇒ Object
17 18 19 20 21 22 23 24 |
# File 'app/controllers/morpho/unlocks_controller.rb', line 17 def show if user && user.login_locked? user.login_unlock! redirect_to sign_in_path, success: I18n.t('morpho.messages.unlocks.unlock.success') else redirect_to sign_in_path, error: I18n.t('morpho.messages.unlocks.unlock.failure') end end |