2022-05-04 23:09:46 +00:00
{% extends "settings.html" %}
{% block pagetitle %}Security Settings - {{SITE_NAME}}{% endblock %}
{% block content %}
2022-09-24 07:04:06 +00:00
< script defer src = "{{'js/settings_security.js' | asset}}" > < / script >
2022-07-13 17:07:59 +00:00
2022-05-04 23:09:46 +00:00
< div class = "row" >
< div class = "col col-lg-8" >
< div class = "settings" >
2022-10-29 00:52:11 +00:00
< h5 > Email< / h5 >
2022-05-04 23:09:46 +00:00
< p class = "text-small text-muted" > Change the email address used to sign in to your account.< / p >
< div class = "settings-section rounded" >
2022-08-05 17:22:17 +00:00
< form action = "/settings/security" method = "post" >
2022-05-04 23:09:46 +00:00
< input type = "hidden" name = "formkey" value = "{{v.formkey}}" >
< div class = "body" >
< div class = "d-lg-flex" >
< label for = "new-email" class = "w-lg-25" > Email< / label >
< div class = "w-lg-100" >
< input autocomplete = "off" class = "form-control" id = "new_email" { % if v . email % } placeholder = "{{v.email}}" { % else % } placeholder = "Your email" { % endif % }
2022-10-19 10:39:03 +00:00
aria-describedby="new_email" type="email" pattern='{{EMAIL_REGEX_PATTERN}}' name="new_email" required>
2022-05-04 23:09:46 +00:00
{% if v.email and not v.is_activated %}
2022-10-30 15:10:07 +00:00
< div class = "text-danger text-small mt-1" id = "email-verify-text" > Email not verified. You will not be able to recover your account with this email until you verify it. < u > < button type = "button" onclick = "postToast(this,'/verify_email');emailVerifyText()" class = "text-primary font-weight-bold ml-1" > Verify now.< / button > < / u > < / div >
2022-05-04 23:09:46 +00:00
{% elif not v.email %}
2022-06-27 02:35:40 +00:00
< div class = "text-danger text-small mt-1" id = "email-verify-text" > Add an email to secure your account in case you forget your password.< / div >
2022-05-04 23:09:46 +00:00
{% endif %}
< / div >
< / div >
< div class = "d-lg-flex mt-3" >
< label for = "email-password" class = "w-lg-25 d-none" id = "email-password-label" > Password< / label >
< div class = "w-lg-100" >
< input autocomplete = "off" type = "password" class = "form-control mb-2 d-none" id = "email-password" name = "password" required >
< small id = "emailpasswordRequired" class = "form-text font-weight-bold text-danger d-none mt-1" > Password required to update your email.< / small >
< / div >
< / div >
< small id = "emailpasswordRequired" class = "form-text font-weight-bold text-danger d-none mt-1" > Password required to update your email.< / small >
< / div >
< div class = "footer" >
< div class = "d-flex" >
2022-10-30 18:43:06 +00:00
{% if FEATURES['PROCOINS'] %}
2022-09-13 16:53:19 +00:00
{% if KOFI_TOKEN %}
2022-10-30 15:10:07 +00:00
< button type = "button" class = "btn btn-success" onclick = "postToast(this,'/settings/kofi')" > Claim {{patron}} rewards< / button >
2022-09-13 16:53:19 +00:00
{% else %}
2022-10-30 15:10:07 +00:00
< button type = "button" class = "btn btn-success" onclick = "postToast(this,'/settings/gumroad')" > Claim {{patron}} rewards< / button >
2022-09-13 16:53:19 +00:00
{% endif %}
2022-05-04 23:09:46 +00:00
{% endif %}
{% if v.email %}
2022-06-24 02:53:31 +00:00
< input autocomplete = "off" class = "btn btn-primary ml-auto" type = "submit" onclick = "disable(this)" value = "Update email" >
2022-05-04 23:09:46 +00:00
{% else %}
2022-06-24 02:53:31 +00:00
< input autocomplete = "off" class = "btn btn-primary ml-auto" type = "submit" onclick = "disable(this)" value = "Add email" >
2022-05-04 23:09:46 +00:00
{% endif %}
< / div >
2022-10-30 18:43:06 +00:00
{% if FEATURES['PROCOINS'] %}
< span class = "text-small text-muted pl-1" > Must be same email as the one you used to donate
{% if v.truecoins >= TRUESCORE_DONATE_LIMIT %}
on
{% if KOFI_TOKEN %}
< a rel = "nofollow noopener" class = "text-primary" href = "{{KOFI_LINK}}" > Kofi< / a >
{% else %}
< a rel = "nofollow noopener" class = "text-primary" href = "{{GUMROAD_LINK}}" > Gumroad< / a >
{% endif %}
2022-09-13 16:53:19 +00:00
{% endif %}
< / span >
2022-05-04 23:09:46 +00:00
{% endif %}
< / div >
< / form >
< / div >
2022-10-29 00:52:11 +00:00
< h5 > Password< / h5 >
2022-05-04 23:09:46 +00:00
< p class = "text-small text-muted" > Change your account password.< / p >
< div class = "settings-section rounded" >
< form action = "/settings/security" method = "post" >
< div class = "body" >
< div class = "d-lg-flex" >
< label for = "old_password" class = "mb-0 w-lg-25" > Old Password< / label >
< input autocomplete = "off" class = "form-control mb-2 w-lg-100" id = "old_password"
aria-describedby="old_password" type="password" name="old_password"
required>
< / div >
< div class = "d-lg-flex mt-5" >
< label for = "new_password" class = "mb-0 w-lg-25" > New Password< / label >
< input autocomplete = "off" class = "form-control w-lg-100" id = "new_password"
aria-describedby="new_password" type="password" name="new_password"
required>
< small id = "passwordHelpChange"
class="form-text font-weight-bold text-muted d-none mt-1 w-lg-100">Minimum of 8
characters
required.< / small >
< small id = "passwordHelpChangeSuccess"
class="form-text font-weight-bold text-success d-none mt-1 w-lg-100">Your password
meets the
requirements.
< / small >
< / div >
< div class = "d-lg-flex mt-4" >
< label for = "cnf_password" class = "mb-0 w-lg-25" > Confirm New Password< / label >
< input autocomplete = "off" class = "form-control w-lg-100" id = "cnf_password"
aria-describedby="cnf_password" type="password" name="cnf_password"
required>
< small id = "passwordHelpCnf"
class="form-text font-weight-bold text-muted d-none mt-1 w-lg-100">Passwords do not
match.< / small >
< small id = "passwordHelpCnfSuccess"
class="form-text font-weight-bold text-success d-none mt-1 w-lg-100">Passwords match.
< / small >
< / div >
< / div >
< div class = "footer" >
< input type = "hidden" name = "formkey" value = "{{v.formkey}}" >
< input type = "hidden" name = "now" value = "1563891643" >
< div class = "d-flex" >
< input autocomplete = "off" class = "btn btn-primary ml-auto"
2022-06-24 02:53:31 +00:00
type="submit" onclick="disable(this)" value="Change Password">
2022-05-04 23:09:46 +00:00
< / div >
< / div >
< / form >
< / div >
2022-10-29 00:52:11 +00:00
< h5 > Two-Factor Authentication< / h5 >
2022-05-04 23:09:46 +00:00
< p class = "text-small text-muted" > Change the two-factor settings for your account.< / p >
< div class = "settings-section rounded" >
< div class = "d-lg-flex" >
< div class = "title w-lg-25" >
< label for = "2faToggle" > Use 2-step login< / label >
< / div >
< div class = "body w-lg-100" >
< div class = "custom-control custom-switch" >
< input autocomplete = "off" type = "checkbox" class = "custom-control-input" id = "2faToggle" name = "2faToggle" onchange = "twoStepModal.show()" { % if v . mfa_secret % } checked { % endif % } >
< label class = "custom-control-label" for = "2faToggle" > < / label >
< / div >
2022-07-13 17:07:59 +00:00
< span class = "text-small text-muted" > This requires entering a randomly-generated, 6-digit code and your password to login.< / span >
2022-05-04 23:09:46 +00:00
< / div >
< / div >
< / div >
2022-10-29 00:52:11 +00:00
< h5 > Log Out Everywhere< / h5 >
2022-05-04 23:09:46 +00:00
< p class = "text-small text-muted" > Log all other devices out of your {{SITE_NAME}} account.< / p >
< div class = "settings-section rounded" >
< form action = "/settings/log_out_all_others" method = "post" >
< input type = "hidden" name = "formkey" value = "{{v.formkey}}" >
< div class = "body" >
< div class = "d-lg-flex" >
< label for = "forcelog-password" class = "w-lg-25" id = "email-password-label" > Password< / label >
< div class = "w-lg-100" >
< input autocomplete = "off" type = "password" class = "form-control mb-2" id = "forcelog-password" name = "password" required >
< / div >
< / div >
< small id = "emailpasswordRequired" class = "form-text mt-1" > This will also invalidate any existing recovery links associated with this account.< / small >
< / div >
< div class = "footer" >
< div class = "d-flex" >
< input autocomplete = "off" class = "btn btn-primary ml-auto"
2022-06-24 02:53:31 +00:00
type="submit" onclick="disable(this)" value="Log out everywhere">
2022-05-04 23:09:46 +00:00
< / div >
< / div >
< / form >
< / div >
< / div >
< / div >
< / div >
< / div >
< / div >
< div class = "modal fade" id = "deleteAccountModal" tabindex = "-1" role = "dialog" aria-labelledby = "deleteAccountModal" aria-hidden = "true" >
< div class = "modal-dialog modal-dialog-centered" role = "document" >
< div class = "modal-content" >
< div class = "modal-header" >
< h5 class = "modal-title" > Delete your {{SITE_NAME}} account< / h5 >
2022-10-28 23:35:14 +00:00
< button type = "button" class = "close" data-bs-dismiss = "modal" aria-label = "Close" >
2022-09-08 17:24:00 +00:00
< span aria-hidden = "true" > < i class = "far fa-times" > < / i > < / span >
2022-05-04 23:09:46 +00:00
< / button >
< / div >
2022-10-29 00:52:11 +00:00
< div id = "deleteFormContainer" >
2022-05-04 23:09:46 +00:00
< form id = "deleteAccountForm" method = "post" action = "/settings/delete_account" >
< input type = "hidden" name = "formkey" value = "{{v.formkey}}" >
< div class = "modal-body body" >
< div class = "d-lg-flex" >
< label for = "delete-password" class = "w-lg-25" id = "email-password-label" > Password< / label >
< div class = "w-lg-100" >
< input autocomplete = "off" type = "password" class = "form-control mb-2" id = "delete-password" name = "password" required >
< / div >
< / div >
{% if v.mfa_secret %}
< div class = "d-lg-flex mt-3" >
< label for = "delete-mfa" class = "w-lg-25" id = "email-password-label" > Two-Factor Code< / label >
< div class = "w-lg-100" >
< input autocomplete = "off" type = "text" class = "form-control mb-2" id = "delete-mfa" name = "twofactor" required >
< / div >
< / div >
{% endif %}
< / div >
< / form >
< / div >
< / div >
2022-10-10 05:22:18 +00:00
{% endblock %}