Skip to content

Choice of passkey or password for authentication #290

Answered by janko
JulienSansot asked this question in Q&A
Discussion options

You must be logged in to vote

You could try always rendering the same verify account view, and require different things depending on a query param. I haven't tested this, but something like:

verify_account_view do
  view("verify-account", verify_account_page_title)
end

verify_account_set_password? { param("factor") == "password" }
<!-- app/views/rodauth/verify_account.html.erb -->
<% case params[:factor] %>
<% when "password" %>
  <%= form_with url: rodauth.verify_account_path, method: :post do |form| %>
    <%= form.password_field rodauth.password_param, ... %>
    <%= form.password_field rodauth.password_confirm_param, ... %>
    <%= form.submit "Set Password" %>
  <% end %>
<% when "webauthn" %>
  <%= rodauth.render(

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@JulienSansot
Comment options

Answer selected by JulienSansot
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants