FIX: Ensure users can confirm new emails using security keys

FIX: Ensure users can confirm new emails using security keys

diff --git a/app/views/users_email/show_confirm_new_email.html.erb b/app/views/users_email/show_confirm_new_email.html.erb
index dc56120..d5a49bc 100644
--- a/app/views/users_email/show_confirm_new_email.html.erb
+++ b/app/views/users_email/show_confirm_new_email.html.erb
@@ -46,11 +46,11 @@
       <% elsif @show_security_key %>
         <%= hidden_field_tag 'security_key_challenge', @security_key_challenge, id: 'security-key-challenge' %>	
         <%= hidden_field_tag 'second_factor_method', UserSecondFactor.methods[:security_key] %>	
-        <%= hidden_field_tag 'security_key_allowed_credential_ids', @security_key_allowed_credential_ids, id: 'security-key-allowed-credential-ids' %>
+        <%= hidden_field_tag 'security_key_allowed_credential_ids', @security_key_allowed_credential_ids.join(","), id: 'security-key-allowed-credential-ids' %>
         <div id="security-key-form">
           <h3><%= t('login.security_key_authenticate') %></h3>
           <p><%= t('login.security_key_description') %></p>
-          <%= button_tag t('login.security_key_authenticate'), id: 'submit-security-key' %>
+          <%= button_tag t('login.security_key_authenticate'), id: 'submit-security-key', class: 'btn btn-primary' %>
         </div>
         <br/>
         <% if @show_second_factor %>

GitHub sha: f1b97202

1 Like

How hard is it to add a test?

This commit has been mentioned on Discourse Meta. There might be relevant details there:

https://meta.discourse.org/t/cannot-authenticate-with-yubikey-when-verifying-new-email/154578/24