Open source, privacy-first web analytics. Lightweight, cookie-free Google Analytics alternative. Self-hosted or cloud.
TypeScript analyticsanalytics-dashboardclickhouseelixirgoogle-analyticsmarketingopen-source-analyticsphoenixplausible-analyticspostgresqlprivacyprivacy-friendlyself-hostedsimple-analyticsstatisticstailwindcssweb-analyticswebsite-analyticswebsite-statswebsite-tracking
<Layouts.auth
heading="Use a recovery code"
subtitle="Enter one of your saved recovery codes to sign in."
>
<.auth_container>
<.form
:let={f}
for={@conn.params}
action={~p"/2fa/use_recovery_code"}
class="flex flex-col gap-y-6"
onsubmit="document.getElementById('use-code-button').disabled = true"
>
<div class="flex flex-col gap-y-2">
<.input
type="text"
field={f[:recovery_code]}
autocomplete="off"
autofocus="autofocus"
maxlength="10"
oninvalid="document.getElementById('use-code-button').disabled = false"
required="required"
placeholder="Recovery code"
/>
<p :if={@error} class="text-xs text-red-500 text-center">
{@error}
</p>
</div>
<.button
id="use-code-button"
type="submit"
class="w-full [&>span.label-enabled]:block [&>span.label-disabled]:hidden [&[disabled]>span.label-enabled]:hidden [&[disabled]>span.label-disabled]:block"
>
<span class="label-enabled pointer-events-none">
Verify
</span>
<span class="label-disabled">
<.spinner class="inline-block h-5 w-5 mr-2 text-white dark:text-gray-400" />
Verifying...
</span>
</.button>
</.form>
<div class="mt-6 flex flex-col gap-y-2 text-sm text-gray-500 dark:text-gray-400 text-center">
<p>
<.styled_link href={~p"/2fa/verify"}>
Use authenticator app instead
</.styled_link>
</p>
<p :if={ee?()}>
Lost your recovery codes?
<.styled_link href="https://plausible.io/contact">
Contact us
</.styled_link>
</p>
</div>
</.auth_container>
</Layouts.auth>