logo

mastofe

My custom branche(s) on git.pleroma.social/pleroma/mastofe git clone https://hacktivis.me/git/mastofe.git

recovery_codes_controller.rb (449B)


  1. # frozen_string_literal: true
  2. module Settings
  3. module TwoFactorAuthentication
  4. class RecoveryCodesController < ApplicationController
  5. layout 'admin'
  6. before_action :authenticate_user!
  7. def create
  8. @recovery_codes = current_user.generate_otp_backup_codes!
  9. current_user.save!
  10. flash[:notice] = I18n.t('two_factor_authentication.recovery_codes_regenerated')
  11. render :index
  12. end
  13. end
  14. end
  15. end