You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
489 B
22 lines
489 B
8 years ago
|
# frozen_string_literal: true
|
||
|
|
||
|
module Admin
|
||
2 years ago
|
class Users::TwoFactorAuthenticationsController < BaseController
|
||
6 years ago
|
before_action :set_target_user
|
||
8 years ago
|
|
||
|
def destroy
|
||
7 years ago
|
authorize @user, :disable_2fa?
|
||
8 years ago
|
@user.disable_two_factor!
|
||
7 years ago
|
log_action :disable_2fa, @user
|
||
5 years ago
|
UserMailer.two_factor_disabled(@user).deliver_later!
|
||
3 years ago
|
redirect_to admin_account_path(@user.account_id)
|
||
8 years ago
|
end
|
||
|
|
||
|
private
|
||
|
|
||
6 years ago
|
def set_target_user
|
||
8 years ago
|
@user = User.find(params[:user_id])
|
||
|
end
|
||
|
end
|
||
|
end
|