Class: QuoVadis::TwofasController

Inherits:
QuoVadisController show all
Defined in:
app/controllers/quo_vadis/twofas_controller.rb

Instance Method Summary collapse

Instance Method Details

#destroyObject



11
12
13
14
15
16
17
18
# File 'app/controllers/quo_vadis/twofas_controller.rb', line 11

def destroy
  .totp&.destroy
  .recovery_codes.delete_all
  .sessions.each &:reset_authenticated_with_second_factor  # OWASP ASV v4.0, 2.8.6
  qv.log , Log::TWOFA_DEACTIVATED
  QuoVadis.notify :twofa_deactivated_notification, email: authenticated_model.email
  redirect_to twofa_path, notice: QuoVadis.translate('flash.2fa.invalidated'), status: :see_other
end

#showObject



7
8
9
# File 'app/controllers/quo_vadis/twofas_controller.rb', line 7

def show
  @recovery_codes_count = .recovery_codes.count
end