Reset Password
Enter your email to receive a verification code
{ loading = true; message = ''; try { const response = await fetch('/auth/forgot-password/send-otp/', { method: 'POST', headers: { 'Content-Type': 'application/json', 'X-CSRFToken': 'M0T7EFeOWq5XT96MtzHqgl6CnrbD8uJ0xTlI4KLRHuSJ6dSmajyKhi8sYOd2ZYI9' }, body: JSON.stringify({ email: email }) }); const data = await response.json(); if (response.ok) { message = 'Verification code sent to your email'; messageType = 'success'; stage = 'otp'; } else { message = data.error || 'Failed to send verification code'; messageType = 'error'; } } catch (error) { message = 'An error occurred. Please try again.'; messageType = 'error'; } finally { loading = false; } }" class="bg-white p-8 rounded-2xl shadow-sm border border-gray-200 space-y-6">
Email Address
Send Verification Code
Sending...
← Back to Sign In
{ loading = true; message = ''; try { const response = await fetch('/auth/forgot-password/verify-otp/', { method: 'POST', headers: { 'Content-Type': 'application/json', 'X-CSRFToken': 'M0T7EFeOWq5XT96MtzHqgl6CnrbD8uJ0xTlI4KLRHuSJ6dSmajyKhi8sYOd2ZYI9' }, body: JSON.stringify({ email: email, otp: otp }) }); const data = await response.json(); if (response.ok) { message = 'Code verified! Enter your new password'; messageType = 'success'; stage = 'new_password'; } else { message = data.error || 'Invalid verification code'; messageType = 'error'; } } catch (error) { message = 'An error occurred. Please try again.'; messageType = 'error'; } finally { loading = false; } }" class="bg-white p-8 rounded-2xl shadow-sm border border-gray-200 space-y-6">
We've sent a 6-digit code to
Verification Code
Verify Code
Verifying...
← Use different email
{ if (password !== confirmPassword) { message = 'Passwords do not match'; messageType = 'error'; return; } if (password.length < 8) { message = 'Password must be at least 8 characters long'; messageType = 'error'; return; } loading = true; message = ''; try { const response = await fetch('/auth/forgot-password/reset/', { method: 'POST', headers: { 'Content-Type': 'application/json', 'X-CSRFToken': 'M0T7EFeOWq5XT96MtzHqgl6CnrbD8uJ0xTlI4KLRHuSJ6dSmajyKhi8sYOd2ZYI9' }, body: JSON.stringify({ email: email, otp: otp, password: password }) }); const data = await response.json(); if (response.ok) { message = 'Password reset successful! Redirecting...'; messageType = 'success'; setTimeout(() => { window.location.href = '/auth/signin/'; }, 2000); } else { message = data.error || 'Failed to reset password'; messageType = 'error'; } } catch (error) { message = 'An error occurred. Please try again.'; messageType = 'error'; } finally { loading = false; } }" class="bg-white p-8 rounded-2xl shadow-sm border border-gray-200 space-y-6">
New Password
Confirm New Password
Reset Password
Resetting...