ubicloud/views/auth/webauthn_auth.erb
Jeremy Evans 311699eac2 Use herb linter for linting erb files, and fix most issues
After running these changes, there are 1 error and 3 warnings when
running the linter, due to bugs in the linter
(https://github.com/marcoroth/herb/issues 480, 481, 483).
2025-09-05 14:51:03 -07:00

49 lines
1.5 KiB
Text

<% @page_title = "2FA - Security Keys" %>
<% @page_message = "Verify your sign in" %>
<% form(:action => rodauth.webauthn_auth_form_path, :role => :form, :method => :post, :class => "rodauth space-y-6", :id => "webauthn-auth-form", "data-credential-options" => (cred = rodauth.webauthn_credential_options_for_get).as_json.to_json) do %>
<%== rodauth.webauthn_auth_additional_form_tags %>
<%== part("components/form/hidden", name: rodauth.webauthn_auth_challenge_param, value: cred.challenge) %>
<%== part(
"components/form/hidden",
name: rodauth.webauthn_auth_challenge_hmac_param,
value: rodauth.compute_hmac(cred.challenge)
) %>
<input
id="webauthn-auth"
class="hidden"
type="text"
name="<%= rodauth.webauthn_auth_param %>"
value=""
hidden
>
<div id="webauthn-auth-button" class="flex flex-col text-center">
<%== part("components/form/submit_button", text: rodauth.webauthn_auth_button) %>
</div>
<p class="mt-10 text-center text-sm text-gray-400">
Can't access your authentication app?
<br>
Can't access your authentication app?
<br>
<a
href="/<%= rodauth.recovery_auth_route %>"
class="font-semibold leading-6 text-orange-500 hover:text-orange-700"
>
Enter a recovery code
</a>
or
<a
href="mailto:support@ubicloud.com"
class="font-semibold leading-6 text-orange-500 hover:text-orange-700"
>
contact support
</a>
</p>
<% end %>
<script
src="<%= "#{rodauth.webauthn_js_host}#{rodauth.webauthn_auth_js_path}" %>"
></script>