index.eta 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <% layout("/en/layout", { title: "auth" }) %>
  2. <%~ include("/en/partials/navbar") %>
  3. <% const authIcon = `
  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="M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z" />
  7. <circle cx="16.5" cy="7.5" r=".5" fill="currentColor" />
  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 sendIcon = `
  17. <svg class="icon" xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
  18. <path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11zm7.318-19.539l-10.94 10.939" />
  19. </svg>
  20. ` %>
  21. <h1><%~ authIcon %> auth</h1>
  22. <p>enter your email and click on the link you will get.</p>
  23. <% const errorValue = it.error?.split('.').reduce((a, b) => a[b], it.lang.auth?.errors)?.(it?.errorDetails) %>
  24. <% if (typeof errorValue === "string") { %>
  25. <div class="message error">
  26. <p class="messageText"><%~ errorIcon %> <%= errorValue %></p>
  27. </div>
  28. <% } %>
  29. <form action="/en/auth" method="post">
  30. <input type="email" name="email" placeholder="your@email.com" required />
  31. <div class="cf-turnstile" data-sitekey="<%= it.siteKey %>"></div>
  32. <button type="submit"><%~ sendIcon %> send</button>
  33. </form>
  34. <script
  35. src="https://challenges.cloudflare.com/turnstile/v0/api.js"
  36. async
  37. defer
  38. ></script>