Spaces:
Sleeping
Sleeping
File size: 2,289 Bytes
c024705 eeacc46 c024705 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 |
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Debug Forgot Password</title>
<style>
body { font-family: Arial, sans-serif; padding: 20px; }
.debug-info { background: #f0f0f0; padding: 10px; margin: 10px 0; border-radius: 5px; }
.error { color: red; }
.success { color: green; }
</style>
</head>
<body>
<h1>Debug Forgot Password</h1>
<div class="debug-info">
<h3>Testing Forgot Password API</h3>
<button onclick="testForgotPassword()">Test Forgot Password</button>
<div id="result"></div>
</div>
<script>
const API_ROOT = 'https://prodevroger-ishingiro.hf.space';
async function api(path, opts) {
const url = API_ROOT + path;
const res = await fetch(url, opts);
if (!res.ok) {
const txt = await res.text();
throw new Error(txt || res.statusText);
}
return res.json();
}
async function testForgotPassword() {
const resultDiv = document.getElementById('result');
resultDiv.innerHTML = '<p>Testing...</p>';
try {
console.log('Testing forgot password for: it.elias38@gmail.com');
const res = await api('/forgot_password', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ email: 'it.elias38@gmail.com' })
});
console.log('API response:', res);
resultDiv.innerHTML = `
<div class="success">
<h4>✅ Success!</h4>
<pre>${JSON.stringify(res, null, 2)}</pre>
</div>
`;
} catch (err) {
console.error('Error:', err);
resultDiv.innerHTML = `
<div class="error">
<h4>❌ Error:</h4>
<p>${err.message}</p>
</div>
`;
}
}
</script>
</body>
</html>
|