File size: 1,329 Bytes
88211d3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<.auth_container>
  <.form
    :let={f}
    action={Routes.auth_path(@conn, :verify_2fa, Map.take(@conn.query_params, ["return_to"]))}
    for={@conn.params}
    class="flex flex-col gap-y-6"
    onsubmit="document.getElementById('verify-button').disabled = true"
  >
    <PlausibleWeb.Components.TwoFactor.verify_2fa_input
      form={f}
      field={:code}
      class=""
      autofocus?={true}
      error={@error}
    />

    <div class="flex justify-center items-center">
      <.input
        type="checkbox"
        field={f[:remember_2fa]}
        value="true"
        label={"Remember this device for #{@remember_2fa_days} days"}
        mt?={false}
        class="block size-5 rounded-sm dark:bg-gray-700 border-gray-300 text-indigo-600 focus:ring-indigo-600"
      />
    </div>

    <.input type="hidden" field={f[:return_to]} mt?={false} />
  </.form>

  <div class="mt-6 flex flex-col gap-y-2 text-sm text-gray-500 dark:text-gray-400 text-center">
    <p>
      Can't access your authenticator app?
      <.styled_link href={Routes.auth_path(@conn, :verify_2fa_recovery_code_form)}>
        Use a recovery code
      </.styled_link>
    </p>
    <p :if={ee?()}>
      Need help?
      <.styled_link href="https://plausible.io/contact">
        Contact us
      </.styled_link>
    </p>
  </div>
</.auth_container>