Skip to content

Commit aa83641

Browse files
committed
fix merge conflicts
1 parent e421ec4 commit aa83641

2 files changed

Lines changed: 6 additions & 15 deletions

File tree

lib/devise/webauthn/helpers/credentials_helper.rb

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -58,15 +58,6 @@ def login_with_security_key_form_for(resource_or_resource_name, form_classes: ni
5858
end
5959
end
6060
end
61-
62-
private
63-
64-
def resource_human_palatable_identifier
65-
authentication_keys = resource.class.authentication_keys
66-
authentication_keys = authentication_keys.keys if authentication_keys.is_a?(Hash)
67-
68-
authentication_keys.filter_map { |authentication_key| resource.public_send(authentication_key) }.first
69-
end
7061
end
7162
end
7263
end

spec/helpers/devise/webauthn/credentials_helper_spec.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def have_hidden_credential_field
4848

4949
describe "#login_with_passkey_form_for" do
5050
it "renders a form with webauthn_get element and hidden credential field" do
51-
html = helper.login_with_passkey_form_for(session_path: "/accounts/sign_in") do |form|
51+
html = helper.login_with_passkey_form_for(:account) do |form|
5252
form.submit "Log in with passkeys"
5353
end
5454

@@ -60,15 +60,15 @@ def have_hidden_credential_field
6060
end
6161

6262
it "accepts form_classes option" do
63-
html = helper.login_with_passkey_form_for(session_path: "/sign_in", form_classes: "passkey-form") do |form|
63+
html = helper.login_with_passkey_form_for(:account, form_classes: "passkey-form") do |form|
6464
form.submit "Login"
6565
end
6666

6767
expect(parse(html)).to have_css("form.passkey-form")
6868
end
6969

7070
it "allows custom content in the block" do
71-
html = helper.login_with_passkey_form_for(session_path: "/sign_in") do |form|
71+
html = helper.login_with_passkey_form_for(:account) do |form|
7272
helper.content_tag(:div, class: "button-wrapper") do
7373
form.submit "Sign in", class: "btn-primary"
7474
end
@@ -104,7 +104,7 @@ def have_hidden_credential_field
104104

105105
describe "#login_with_security_key_form_for" do
106106
it "renders a form with webauthn_get element" do
107-
html = helper.login_with_security_key_form_for(resource: user) do |form|
107+
html = helper.login_with_security_key_form_for(:account) do |form|
108108
form.submit "Use security key"
109109
end
110110

@@ -116,15 +116,15 @@ def have_hidden_credential_field
116116
end
117117

118118
it "accepts form_classes option" do
119-
html = helper.login_with_security_key_form_for(resource: user, form_classes: "two-factor-form") do |form|
119+
html = helper.login_with_security_key_form_for(:account, form_classes: "two-factor-form") do |form|
120120
form.submit "Verify"
121121
end
122122

123123
expect(parse(html)).to have_css("form.two-factor-form")
124124
end
125125

126126
it "allows custom content in the block" do
127-
html = helper.login_with_security_key_form_for(resource: user) do |form|
127+
html = helper.login_with_security_key_form_for(:account) do |form|
128128
helper.safe_join([helper.content_tag(:p, "Authenticate with your security key"), form.submit("Authenticate")])
129129
end
130130

0 commit comments

Comments
 (0)