Define `Settings::BaseController#set_body_classes` so that sub classes inherit `Settings::BaseController` don't need to define `#set_body_classes` agein.
18 lines
442 B
Ruby
18 lines
442 B
Ruby
# frozen_string_literal: true
|
|
|
|
module Settings
|
|
module TwoFactorAuthentication
|
|
class RecoveryCodesController < BaseController
|
|
layout 'admin'
|
|
|
|
before_action :authenticate_user!
|
|
|
|
def create
|
|
@recovery_codes = current_user.generate_otp_backup_codes!
|
|
current_user.save!
|
|
flash[:notice] = I18n.t('two_factor_authentication.recovery_codes_regenerated')
|
|
render :index
|
|
end
|
|
end
|
|
end
|
|
end
|