mirror of
https://github.com/discourse/discourse.git
synced 2025-05-28 22:27:49 +08:00
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 dd6ec65061e747442f3d2ab0eb60764e88eff2d8)
This commit is contained in:
@ -94,7 +94,7 @@ describe SecondFactor::AuthManager do
|
||||
action
|
||||
.expects(:second_factor_auth_required!)
|
||||
.with({ expect_me: 131 })
|
||||
.returns({ callback_params: { call_me_back: 4314 }, redirect_path: "/gg" })
|
||||
.returns({ callback_params: { call_me_back: 4314 }, redirect_path: "/gg", description: "hello world!" })
|
||||
.once
|
||||
action.expects(:second_factor_auth_completed!).never
|
||||
manager = create_manager(action)
|
||||
@ -114,6 +114,7 @@ describe SecondFactor::AuthManager do
|
||||
expect(challenge[:redirect_path]).to eq("/gg")
|
||||
expect(challenge[:allowed_methods]).to eq(manager.allowed_methods.to_a)
|
||||
expect(challenge[:callback_params]).to eq({ call_me_back: 4314 })
|
||||
expect(challenge[:description]).to eq("hello world!")
|
||||
end
|
||||
|
||||
it "sets the redirect_path to the root path if second_factor_auth_required! doesn't specify a redirect_path" do
|
||||
|
Reference in New Issue
Block a user