verify.eta 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <% layout("/en/layout", { title: "verification" }) %>
  2. <%~ include("/en/partials/navbar") %>
  3. <% const verificationIcon = `
  4. <svg class="icon" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
  5. <g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2">
  6. <path d="M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z" />
  7. <path d="M9.1 9a3 3 0 0 1 5.82 1c0 2-3 3-3 3m.08 4h.01" />
  8. </g>
  9. </svg>
  10. ` %>
  11. <% const errorIcon = `
  12. <svg class="icon" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
  13. <path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m21.73 18l-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3M12 9v4m0 4h.01" />
  14. </svg>
  15. ` %>
  16. <% const verifyIcon = `
  17. <svg class="icon" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
  18. <g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2">
  19. <path d="M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z" />
  20. <path d="m9 12l2 2l4-4" />
  21. </g>
  22. </svg>
  23. ` %>
  24. <h1><%~ verificationIcon %> verification</h1>
  25. <p>enter the code you got in your email or click on the link.</p>
  26. <% const errorValue = it.error?.split('.').reduce((a, b) => a[b], it.lang.auth?.errors)?.(it?.errorDetails) %>
  27. <% if (typeof errorValue === "string") { %>
  28. <div class="message error">
  29. <p class="messageText"><%~ errorIcon %> <%= errorValue %></p>
  30. </div>
  31. <% } %>
  32. <form action="/en/auth/verify">
  33. <input type="text" name="token" value="<%= it.token %>" style="display: none;" />
  34. <input type="text" pattern="\d+" minlength="6" maxlength="6" name="code" placeholder="676767" />
  35. <button type="submit"><%~ verifyIcon %> verify</button>
  36. </form>