Class: Masq::YubikeyAssociationsController

Inherits:
BaseController
  • Object
show all
Defined in:
app/controllers/masq/yubikey_associations_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject



5
6
7
8
9
10
11
12
13
14
# File 'app/controllers/masq/yubikey_associations_controller.rb', line 5

def create
  if .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() }
  end
end

#destroyObject



16
17
18
19
20
21
22
23
# File 'app/controllers/masq/yubikey_associations_controller.rb', line 16

def destroy
  .yubico_identity = nil
  .save

  respond_to do |format|
    format.html { redirect_to(, notice: t(:account_disassociated_from_yubico_identity)) }
  end
end