feat: a new account e-mail is confirmed with a code, and the old one is told
Changing the e-mail in Dados da conta took effect at once, with nothing checking the new address: a typo locked the customer out, and anyone at a signed-in computer who knew the password could move the account to their own e-mail and then reset its password. Now the code goes to the new address, the account changes only once it is entered (same screen and limits as signup, and only the account that asked can complete it), and the old address gets "O e-mail da sua conta foi trocado", with the WhatsApp to call if it was not them. Without e-mail on, it changes at once as before. Signup and e-mail change share one code check (expiry, five attempts, the 60 s resend wait). Tested: mail_test (wrong password, same and taken e-mail, wrong code, another account's attempt, resend wait, the notice), the full suite in a CI-style stack, and the screen in Brave. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -166,7 +166,20 @@
|
||||
<h2>E-mail</h2>
|
||||
<label for="dMail">E-mail</label><input id="dMail" type="email" autocomplete="email" required>
|
||||
<label for="dMailSenha">Senha atual, para confirmar</label><input id="dMailSenha" type="password" autocomplete="current-password" required>
|
||||
<button class="bSec">Alterar e-mail</button>
|
||||
<button class="bSec" id="dMailOk">Alterar e-mail</button>
|
||||
</form>
|
||||
<!-- Takes the place of the e-mail form until the new address is confirmed. -->
|
||||
<form class="bloco" id="fEmailCodigo" hidden>
|
||||
<h2>Confirme o novo e-mail</h2>
|
||||
<p class="nota2">Enviamos um código de 6 números para <b id="emailNovo"></b>. O e-mail da conta só muda depois que você digitar o código.</p>
|
||||
<label for="emailCodigo">Código</label>
|
||||
<input id="emailCodigo" class="codigo" inputmode="numeric" autocomplete="one-time-code" pattern="[0-9]{6}" maxlength="6" required>
|
||||
<button class="bSec" id="emailCodigoOk">Confirmar novo e-mail</button>
|
||||
<div class="codigoAcoes">
|
||||
<button type="button" class="bLink" id="emailReenviar" disabled>Reenviar código</button>
|
||||
<button type="button" class="bLink" id="emailCancelar">Cancelar</button>
|
||||
</div>
|
||||
<p class="nota2">Não chegou? Confira a caixa de spam.</p>
|
||||
</form>
|
||||
<form class="bloco" id="fSenha">
|
||||
<h2>Senha</h2>
|
||||
|
||||
Reference in New Issue
Block a user