import { render } from 'solid-js/web'; import { createSignal, Show, onMount } from 'solid-js'; const IconEye = () => ; const IconEyeOff = () => ; function App() { const [step, setStep] = createSignal(1); const [loading, setLoading] = createSignal(false); const [status, setStatus] = createSignal(''); const [identifier, setIdentifier] = createSignal(''); const [otpCode, setOtpCode] = createSignal(''); const [newPass, setNewPass] = createSignal(''); const [showPass, setShowPass] = createSignal(false); async function handleSubmit(e) { e.preventDefault(); setLoading(true); setStatus(''); let body = {}; let action = ''; let nextStep = 0; if (step() === 1) { if (!identifier()) { setStatus('Please enter your username or email.'); setLoading(false); return; } action = 'SendOtp'; body = { identifier: identifier(), action }; nextStep = 2; } else if (step() === 2) { if (!otpCode() || !newPass()) { setStatus('Please fill in both the OTP and your new password.'); setLoading(false); return; } action = 'ResetPassword'; body = { identifier: identifier(), action, otpCode: otpCode(), newPass: newPass() }; } try { const res = await fetch('/private/server/exocore/web/forgotpass', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(body), }); const data = await res.json(); if (!res.ok) throw new Error(data.error || 'Request failed.'); setStatus(data.data.message || 'Success.'); if (nextStep) { setStep(nextStep); } else { setTimeout(() => { window.location.href = '/private/server/exocore/web/public/login'; }, 2000); } } catch (err) { setStatus(err.message); } finally { setLoading(false); } } return (

Forgot Password

A code was sent. Enter it below with your new password.

setOtpCode(e.currentTarget.value.replace(/\s/g, ''))} placeholder="------" maxlength="6"/>
setNewPass(e.currentTarget.value.replace(/\s/g, ''))} />
} >

Enter your username or email to receive a verification code.

setIdentifier(e.currentTarget.value.replace(/\s/g, ''))} />
{status()}
); } render(() => , document.getElementById('app'));