Send yourself a verification email, then enter the code from it.
Request an update code at your current address, then enter the new address and the code.
Deactivation hides the account until it is reactivated. Takedowns and suspensions are operator actions, not resident controls.
';generatedAppPassword.querySelector('code').textContent=created.password;$('app-password-name').value='';setStatus('app password created','ok');await loadAccountData()}catch(err){setStatus(err.message||String(err),'error')}}
\\$('load-records').onclick=()=>loadRecords(false).catch(err=>setStatus(err.message,'error'));$('next-records').onclick=()=>loadRecords(true).catch(err=>setStatus(err.message,'error'));
\\$('verify-email-request').onclick=async()=>{try{await xrpc('/xrpc/com.atproto.server.requestEmailConfirmation',{}, {method:'POST'});setStatus('verification email sent','ok')}catch(err){setStatus(err.message,'error')}}
- \\$('verify-email-confirm').onclick=async()=>{try{await xrpc('/xrpc/com.atproto.server.confirmEmail',{}, {method:'POST',headers:{'content-type':'application/json'},body:JSON.stringify({email:account.email,token:$('email-token').value.trim()})});setStatus('email verified','ok');await loadAccountData()}catch(err){setStatus(err.message,'error')}}
- \\$('update-email-request').onclick=async()=>{try{const out=await xrpc('/xrpc/com.atproto.server.requestEmailUpdate',{}, {method:'POST'});setStatus(out.tokenRequired?'update code sent':'enter the new email and confirm','ok')}catch(err){setStatus(err.message,'error')}}
- \\$('update-email-confirm').onclick=async()=>{try{const body={email:$('new-email').value.trim()};if($('email-token').value.trim())body.token=$('email-token').value.trim();await xrpc('/xrpc/com.atproto.server.updateEmail',{}, {method:'POST',headers:{'content-type':'application/json'},body:JSON.stringify(body)});setStatus('email updated','ok');await loadAccountData()}catch(err){setStatus(err.message,'error')}}
+ \\$('verify-email-confirm').onclick=async()=>{try{const token=$('verify-code').value.trim();if(!token)throw new Error('Enter the code from the verification email.');await xrpc('/xrpc/com.atproto.server.confirmEmail',{}, {method:'POST',headers:{'content-type':'application/json'},body:JSON.stringify({email:account.email,token})});$('verify-code').value='';setStatus('email verified','ok');await loadAccountData()}catch(err){setStatus(err.message,'error')}}
+ \\$('update-email-request').onclick=async()=>{try{const out=await xrpc('/xrpc/com.atproto.server.requestEmailUpdate',{}, {method:'POST'});setStatus(out.tokenRequired?'update code sent to your current email':'no code needed — enter the new email and confirm','ok')}catch(err){setStatus(err.message,'error')}}
+ \\$('update-email-confirm').onclick=async()=>{try{const email=$('new-email').value.trim();if(!email)throw new Error('Enter the new email address.');const body={email};if($('update-code').value.trim())body.token=$('update-code').value.trim();await xrpc('/xrpc/com.atproto.server.updateEmail',{}, {method:'POST',headers:{'content-type':'application/json'},body:JSON.stringify(body)});$('new-email').value='';$('update-code').value='';setStatus('email updated','ok');await loadAccountData()}catch(err){setStatus(err.message,'error')}}
\\$('activate-account').onclick=async()=>{try{await xrpc('/xrpc/com.atproto.server.activateAccount',{}, {method:'POST'});setStatus('account reactivated','ok');await loadAccountData()}catch(err){setStatus(err.message,'error')}}
\\$('deactivate-account').onclick=async()=>{try{if(!confirm('Deactivate this account? You can reactivate by signing back in.'))return;await xrpc('/xrpc/com.atproto.server.deactivateAccount',{}, {method:'POST'});setStatus('account deactivated','warn');await loadAccountData()}catch(err){setStatus(err.message,'error')}}
\\showView();