{%extends"auth_base.html"%}{%from"_authwin.html"importauthwin%}{%blocktitle%}euler — {{'reset password'ifkind=='reset'else'register'}}{%endblock%}{%blockdialogue%}{%settitle='reset password'ifkind=='reset'else'register'%}{%setintro=('set a new password for '~email)ifkind=='reset'else('create your account for '~email)%}{%setnote%}<b>SRP-6a</b> · your password becomes a verifier in your browser — it never leaves this page.{%endset%}{%callauthwin(title,intro,note)%}{%ifstage=='terms'%}{# Terms acceptance gates the OTP (registration only). The full text is shown inline — acceptance happens on the page that displays it. #}<formclass="auth-form authwin-form"method="post"action="{{base}}/otp"><inputtype="hidden"name="token"value="{{token}}"><pclass="muted">Terms of use</p><divid="terms-box"class="terms-box"tabindex="0">{%include"_terms.html"%}</div><pid="terms-hint"class="muted">Scroll to the end of the terms to enable acceptance.</p><labelclass="check"><inputid="accept-box"type="checkbox"name="accepted"value="yes"requireddisabled> I have read and accept these Terms of use</label><buttonclass="btn btn-primary"type="submit">email me a code</button></form><noscript><pclass="flash flash-error">Registration requires JavaScript.</p></noscript>{%elifstage=='request'%}{# Reset flow: no Terms, just prove mailbox control. #}<formclass="auth-form authwin-form"method="post"action="{{base}}/otp"><inputtype="hidden"name="token"value="{{token}}"><p>To continue, verify that you control this mailbox.</p><buttonclass="btn btn-primary"type="submit">email me a code</button></form>{%elifstage=='otp'%}{# Verify the OTP: 6 digits, 10 minutes, 5 tries. #}<formclass="auth-form authwin-form"method="post"action="{{base}}/verify"><inputtype="hidden"name="token"value="{{token}}"><p>A 6-digit code was sent to your mailbox. It is valid for 10 minutes.</p><labelfor="otp">verification code</label><inputid="otp"name="otp"inputmode="numeric"pattern="[0-9]{6}"maxlength="6"autocomplete="one-time-code"requiredautofocus><buttonclass="btn btn-primary"type="submit">verify</button></form><formclass="auth-links"method="post"action="{{base}}/otp"><inputtype="hidden"name="token"value="{{token}}">{%ifkind=='register'%}<inputtype="hidden"name="accepted"value="yes">{%endif%}<buttonclass="auth-link"type="submit">send a fresh code</button></form>{%elifstage=='password'%}{# Set the password: the browser derives {salt, verifier}; the password never leaves it. #}<formid="password-form"class="auth-form authwin-form"method="post"action="{{base}}/complete"data-email="{{email}}"><inputtype="hidden"name="token"value="{{token}}"><inputtype="hidden"name="salt"value=""><inputtype="hidden"name="verifier"value=""><inputtype="hidden"name="kdf"value=""><labelfor="password">new password</label><divclass="pw-wrap"><inputid="password"type="password"autocomplete="new-password"requiredautofocus><buttontype="button"class="pw-toggle"data-pw-togglearia-controls="password"aria-pressed="false">show</button></div><labelfor="confirm">repeat password</label><divclass="pw-wrap"><inputid="confirm"type="password"autocomplete="new-password"required><buttontype="button"class="pw-toggle"data-pw-togglearia-controls="confirm"aria-pressed="false">show</button></div><pid="caps-warn"class="caps-warn"role="status"hidden>Caps Lock is on</p><pclass="muted">At least 16 characters, using all four of: lowercase, uppercase, digits, and specials. It is turned into an SRP verifier in your browser and never sent anywhere.</p><pid="form-error"class="flash flash-error"role="alert"hidden></p><buttonid="submit-btn"class="btn btn-primary"type="submit">set password</button></form><noscript><pclass="flash flash-error">Setting a password requires JavaScript (the SRP verifier is derived in your browser).</p></noscript>{%endif%}{%endcall%}{%endblock%}{%blockscripts%}{%ifstage=='terms'%}<scriptsrc="{{asset('/assets/terms.js')}}"defer></script>{%elifstage=='password'%}<scriptsrc="{{asset('/assets/srp.js')}}"defer></script><scriptsrc="{{asset('/assets/authform.js')}}"defer></script><scriptsrc="{{asset('/assets/register.js')}}"defer></script>{%endif%}{%endblock%}