mirror of
https://framagit.org/tykayn/mastodon.git
synced 2023-08-25 08:33:12 +02:00
bf1eb0912c
Specifically, this commit: - changes S::TFA::{Confirmations,RecoveryCodes}Controller to derive from S::BaseController, because this gives us the necessary actions and packs - prepends set_pack to Auth::SessionsController's action chain so that it takes effect in time for render :two_factor
15 lines
379 B
Ruby
15 lines
379 B
Ruby
# frozen_string_literal: true
|
|
|
|
module Settings
|
|
module TwoFactorAuthentication
|
|
class RecoveryCodesController < BaseController
|
|
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
|