passwordReset.pug 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. extends ../layout-marketing
  2. include ../_mixins/recaptcha
  3. block vars
  4. - bootstrap5PageStatus = 'disabled'
  5. block content
  6. - var showCaptcha = settings.recaptcha && settings.recaptcha.siteKey && !(settings.recaptcha.disabled && settings.recaptcha.disabled.passwordReset)
  7. if showCaptcha
  8. script(type="text/javascript", nonce=scriptNonce, src="https://www.recaptcha.net/recaptcha/api.js?render=explicit")
  9. div(
  10. id="recaptcha"
  11. class="g-recaptcha"
  12. data-sitekey=settings.recaptcha.siteKey
  13. data-size="invisible"
  14. data-badge="inline"
  15. )
  16. main.content.content-alt#main-content(data-ol-captcha-retry-trigger-area="")
  17. .container-custom-sm.mx-auto
  18. .card
  19. form(
  20. data-ol-async-form
  21. name="passwordResetForm"
  22. action="/user/password/reset",
  23. method="POST",
  24. captcha=(showCaptcha ? '' : false),
  25. captcha-action-name=(showCaptcha ? "passwordReset" : false),
  26. )
  27. if error === 'password_reset_token_expired'
  28. h3.mt-0.mb-2 #{translate("sorry_your_token_expired")}
  29. p #{translate('please_request_a_new_password_reset_email_and_follow_the_link')}.
  30. else
  31. h3.mt-0.mb-2(data-ol-not-sent) #{translate("password_reset")}
  32. h3.mt-0.mb-2(hidden data-ol-sent) #{translate("check_your_email")}
  33. p(data-ol-not-sent) #{translate("enter_your_email_address_below_and_we_will_send_you_a_link_to_reset_your_password")}.
  34. div(data-ol-not-sent)
  35. +formMessages()
  36. if error && error !== 'password_reset_token_expired'
  37. div.alert.alert-danger.mb-2(
  38. role="alert"
  39. aria-live="assertive"
  40. )
  41. | #{translate(error)}
  42. div(data-ol-custom-form-message="no-password-allowed-due-to-sso" hidden)
  43. .notification.notification-type-error(aria-live="polite" style="margin-bottom: 10px;")
  44. .notification-icon
  45. span.material-symbols.material-symbols-rounded(aria-hidden="true") error
  46. .notification-content-and-cta
  47. .notification-content
  48. p
  49. | !{translate("you_cant_reset_password_due_to_sso", {}, [{name: 'a', attrs: {href: '/sso-login'}}])}
  50. input(type="hidden", name="_csrf", value=csrfToken)
  51. .form-group.mb-3
  52. label(for='email') #{translate("email")}
  53. input.form-control#email(
  54. aria-label="email"
  55. type='email',
  56. name='email',
  57. placeholder=translate("enter_your_email_address"),
  58. required,
  59. autocomplete="username",
  60. autofocus
  61. )
  62. .actions
  63. button.btn.btn-primary.w-100(
  64. type='submit',
  65. data-ol-disabled-inflight,
  66. aria-label=translate('request_password_reset_to_reconfirm')
  67. )
  68. span(data-ol-inflight="idle")
  69. | #{translate("request_password_reset")}
  70. span(hidden data-ol-inflight="pending")
  71. | #{translate("requesting_password_reset")}…
  72. div(hidden data-ol-sent)
  73. p.mb-4 #{translate('password_reset_email_sent')}
  74. a(href="/login") #{translate('back_to_log_in')}
  75. if showCaptcha
  76. +recaptchaConditions