The recovery codes are a good backup solution for 2FA. We use the `recovery_codes` plugin from rodauth for this purpose. We don't use recovery codes as the primary 2FA method. Recovery codes are auto-generated upon enabling the first 2FA method and auto-removed after disabling the last 2FA method. Additionally, we redirect users to the recovery code view once a 2FA method is activated, enabling them to save their recovery codes.
30 lines
985 B
Plaintext
30 lines
985 B
Plaintext
<% @page_title = "2FA - Recovery Codes" %>
|
|
|
|
<% @page_message = "Verify your sign in" %>
|
|
|
|
<form action="<%= rodauth.recovery_auth_path %>" class="rodauth space-y-6" role="form" method="POST">
|
|
<%== rodauth.recovery_auth_additional_form_tags %>
|
|
<%== rodauth.csrf_tag(rodauth.recovery_auth_path) %>
|
|
|
|
<%== render(
|
|
"components/form/text",
|
|
locals: {
|
|
name: rodauth.recovery_codes_param,
|
|
label: "#{rodauth.recovery_codes_label}#{rodauth.input_field_label_suffix}",
|
|
attributes: {
|
|
required: true,
|
|
autocomplete: "off"
|
|
}
|
|
}
|
|
) %>
|
|
|
|
<div class="flex flex-col text-center">
|
|
<%== render("components/form/submit_button", locals: { text: rodauth.recovery_auth_button }) %>
|
|
<p class="mt-10 text-center text-sm text-gray-400">
|
|
Can't access your recovery codes?
|
|
<br>
|
|
<a href="mailto:support@ubicloud.com" class="font-semibold leading-6 text-orange-500 hover:text-orange-700">contact support</a>
|
|
</p>
|
|
</div>
|
|
</form>
|