Revert "refactor: move deSEC password-reveal logic from JS to Twig (PRG pattern)"

This reverts commit 1c6ca098d5.
This commit is contained in:
Simon L.
2026-04-26 18:25:39 +02:00
parent 1c6ca098d5
commit 11d8050085
6 changed files with 25 additions and 50 deletions

View File

@@ -4,7 +4,7 @@
{% if desec_account_registered %}
<p>Your deSEC account (<strong>{{ desec_email }}</strong>) was registered successfully but the domain could not be registered. Please enter a desired subdomain slug (the part before <code>.dedyn.io</code>) and try again, or leave it blank for a random one.</p>
<p>Your deSEC login credentials (for <a target="_blank" href="https://desec.io">desec.io</a>): Email: <strong>{{ desec_email }}</strong>. <details style="display:inline"><summary>Reveal deSEC password</summary><strong>{{ desec_password }}</strong></details>. Please save these in a safe place.</p>
<form method="POST" action="api/desec/register">
<form method="POST" action="api/desec/register" class="xhr">
<input type="hidden" name="{{csrf.keys.name}}" value="{{csrf.name}}">
<input type="hidden" name="{{csrf.keys.value}}" value="{{csrf.value}}">
<input type="text" name="desec_slug" placeholder="my-nextcloud (optional)" pattern="[a-z0-9]([a-z0-9\-]{0,61}[a-z0-9])?" title="Only lowercase letters, digits and hyphens (163 characters). No leading or trailing hyphen." />
@@ -12,17 +12,14 @@
</form>
{% else %}
<p>Please enter your email address. You can also enter a desired subdomain slug (the part before <code>.dedyn.io</code>); leave it blank for a random one.</p>
{% if desec_error %}
<p style="color: var(--color-error-text)">{{ desec_error }}</p>
{% endif %}
<form method="POST" action="api/desec/register">
<form method="POST" action="api/desec/register" class="xhr" data-reveal-on-error="#desec-password-field" data-reveal-when="already registered at deSEC">
<input type="hidden" name="{{csrf.keys.name}}" value="{{csrf.name}}">
<input type="hidden" name="{{csrf.keys.value}}" value="{{csrf.value}}">
<input type="email" name="desec_email" placeholder="your@email.com" required {% if desec_prefill_email %}value="{{ desec_prefill_email }}"{% endif %} />
{% if desec_show_password %}
<input type="email" name="desec_email" placeholder="your@email.com" required />
<div id="desec-password-field" style="display:none">
<p>This email address is already registered at deSEC. Enter your deSEC password below to log in with it instead of creating a new account.</p>
<input type="password" name="desec_password" placeholder="deSEC password" autocomplete="current-password" />
{% endif %}
</div>
<input type="text" name="desec_slug" placeholder="my-nextcloud (optional)" pattern="[a-z0-9]([a-z0-9\-]{0,61}[a-z0-9])?" title="Only lowercase letters, digits and hyphens (163 characters). No leading or trailing hyphen." />
<input type="submit" value="Register free domain via deSEC" />
</form>