discourse/spec/support/test_second_factor_action.rb
Osama Sayegh 8c71878ff5
UX: Add description to the 2FA page when adding new admins (#16098)
This PR adds an extra description to the 2FA page when granting a user admin access. It also introduces a general system for adding customized descriptions that can be used by future actions.

(Follow-up to dd6ec65061)
2022-03-04 06:43:06 +03:00

21 lines
492 B
Ruby

# frozen_string_literal: true
class TestSecondFactorAction < SecondFactor::Actions::Base
def no_second_factors_enabled!(params)
end
def second_factor_auth_required!(params)
{
redirect_path: params[:redirect_path],
callback_params: {
saved_param_1: params[:saved_param_1],
saved_param_2: params[:saved_param_2]
},
description: "this is description for test action"
}
end
def second_factor_auth_completed!(callback_params)
end
end