]> cat aescling's git repositories - mastodon.git/commitdiff
Explicitly set userVerification to discoraged (#16545)
authorTruong Nguyen <truongnmt.dev@gmail.com>
Thu, 26 Aug 2021 14:51:22 +0000 (23:51 +0900)
committersingle-right-quote <34298117+single-right-quote@users.noreply.github.com>
Wed, 1 Sep 2021 00:27:19 +0000 (00:27 +0000)
app/controllers/auth/sessions_controller.rb
app/controllers/settings/two_factor_authentication/webauthn_credentials_controller.rb

index b66dbd9d2aa109f2c12dcb07eccfecf49120bf6f..f2e88d3635090b2aad1157fa75bf5f2f6abb4178 100644 (file)
@@ -47,7 +47,10 @@ class Auth::SessionsController < Devise::SessionsController
     user = find_user
 
     if user&.webauthn_enabled?
-      options_for_get = WebAuthn::Credential.options_for_get(allow: user.webauthn_credentials.pluck(:external_id))
+      options_for_get = WebAuthn::Credential.options_for_get(
+        allow: user.webauthn_credentials.pluck(:external_id),
+        user_verification: 'discouraged'
+      )
 
       session[:webauthn_challenge] = options_for_get.challenge
 
index bd6f83134c3fcf9fe9eb9f405959dba59fb21e2f..7e2d43dcd312318c84c4199a64cc8e308ae790f6 100644 (file)
@@ -21,7 +21,8 @@ module Settings
             display_name: current_user.account.username,
             id: current_user.webauthn_id,
           },
-          exclude: current_user.webauthn_credentials.pluck(:external_id)
+          exclude: current_user.webauthn_credentials.pluck(:external_id),
+          authenticator_selection: { user_verification: 'discouraged' }
         )
 
         session[:webauthn_challenge] = options_for_create.challenge