6
7
8
9
10
11
12
13
14
15
16
17
18
|
# File 'lib/generators/action_passkey/install/templates/passkey_sessions_controller.rb', line 6
def create
credential, passkey = passkey_relying_party.verify_authentication(
passkey_params.to_h,
session.delete(:passkey_authentication_challenge)
) do |webauthn_credential|
Passkey.find_by!(external_id: webauthn_credential.id)
end
passkey.update!(sign_count: credential.sign_count)
start_new_session_for passkey.user
render json: { location: after_authentication_url }, status: :created
end
|