mirror of
https://github.com/discourse/discourse.git
synced 2024-12-01 00:33:44 +08:00
a1c1f7ce75
Switches to using a dialog to confirm a session (i.e. sudo mode for account changes where we want to be extra sure the current user is who they say they are) to match what we do with passkeys.
20 lines
476 B
Ruby
20 lines
476 B
Ruby
# frozen_string_literal: true
|
|
|
|
module PageObjects
|
|
module Pages
|
|
class UserPreferencesSecurity < PageObjects::Pages::Base
|
|
def visit(user)
|
|
page.visit("/u/#{user.username}/preferences/security")
|
|
self
|
|
end
|
|
|
|
def visit_second_factor(password)
|
|
click_button "Manage Two-Factor Authentication"
|
|
|
|
find(".dialog-body input#password").fill_in(with: password)
|
|
find(".dialog-body .btn-primary").click
|
|
end
|
|
end
|
|
end
|
|
end
|