Skip to content

Commit 6d21066

Browse files
committed
use resource_name instead of resource object
1 parent e1d495f commit 6d21066

4 files changed

Lines changed: 4 additions & 4 deletions

File tree

app/controllers/devise/passkey_authentication_options_controller.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
module Devise
44
class PasskeyAuthenticationOptionsController < DeviseController
5-
def index
5+
def show
66
passkey_options =
77
WebAuthn::Credential.options_for_get(
88
user_verification: "required"

lib/devise/webauthn/helpers/credentials_helper.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def login_with_passkey_button(text = nil, session_path:, button_classes: nil, fo
2323
method: :post,
2424
class: form_classes
2525
) do |f|
26-
tag.webauthn_get(data: { options_url: passkey_authentication_options_path(resource) }) do
26+
tag.webauthn_get(data: { options_url: passkey_authentication_options_path(resource_name) }) do
2727
concat f.hidden_field(:public_key_credential, data: { webauthn_target: "response" })
2828

2929
concat f.button(text, type: "submit", class: button_classes, &block)

lib/devise/webauthn/routes.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ class Mapper
88
def devise_passkey_authentication(_mapping, controllers)
99
resources :passkeys, only: %i[new create destroy], controller: controllers[:passkeys]
1010

11-
resources :passkey_authentication_options, only: :index,
11+
resource :passkey_authentication_options, only: :show,
1212
controller: controllers[:passkey_authentication_options]
1313
resources :passkey_registration_options, only: :index, controller: controllers[:passkey_registration_options]
1414
end

spec/requests/devise/passkey_authentication_options_controller_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
require "spec_helper"
44

55
RSpec.describe Devise::PasskeyAuthenticationOptionsController, type: :request do
6-
describe "GET #index" do
6+
describe "GET #show" do
77
it "stores the challenge in session and returns it as json" do
88
get account_passkey_authentication_options_path
99

0 commit comments

Comments
 (0)