10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
# File 'app/controllers/devise/security_key_registration_options_controller.rb', line 10
def create
create_security_key_options =
WebAuthn::Credential.options_for_create(
user: {
id: resource.webauthn_id,
name: resource_human_palatable_identifier
},
exclude: resource.webauthn_credentials.pluck(:external_id),
authenticator_selection: {
resident_key: "discouraged",
user_verification: "discouraged"
}
)
session[:webauthn_challenge] = create_security_key_options.challenge
render json: create_security_key_options
end
|