Class: Masq::YubikeyAssociationsController
- Inherits:
-
BaseController
- Object
- ActionController::Base
- BaseController
- Masq::YubikeyAssociationsController
- Defined in:
- app/controllers/masq/yubikey_associations_controller.rb
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
5 6 7 8 9 10 11 12 13 14 |
# File 'app/controllers/masq/yubikey_associations_controller.rb', line 5 def create if current_account.associate_with_yubikey(params[:yubico_otp]) flash[:notice] = t(:account_associated_with_yubico_identity) else flash[:alert] = t(:sorry_yubico_one_time_password_incorrect) end respond_to do |format| format.html { redirect_to(edit_account_path) } end end |
#destroy ⇒ Object
16 17 18 19 20 21 22 23 |
# File 'app/controllers/masq/yubikey_associations_controller.rb', line 16 def destroy current_account.yubico_identity = nil current_account.save respond_to do |format| format.html { redirect_to(edit_account_path, notice: t(:account_disassociated_from_yubico_identity)) } end end |