logo

mastofe

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

two_factor_authentications_controller.rb (392B)


  1. # frozen_string_literal: true
  2. module Admin
  3. class TwoFactorAuthenticationsController < BaseController
  4. before_action :set_user
  5. def destroy
  6. authorize @user, :disable_2fa?
  7. @user.disable_two_factor!
  8. log_action :disable_2fa, @user
  9. redirect_to admin_accounts_path
  10. end
  11. private
  12. def set_user
  13. @user = User.find(params[:user_id])
  14. end
  15. end
  16. end