-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest-auth.html
More file actions
43 lines (37 loc) · 1.39 KB
/
test-auth.html
File metadata and controls
43 lines (37 loc) · 1.39 KB
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
<!DOCTYPE html>
<html>
<head>
<title>Auth Test</title>
</head>
<body>
<h1>Authentication Test</h1>
<div id="results"></div>
<script>
async function testAuth() {
const results = document.getElementById('results');
try {
// Test health endpoint
const healthResponse = await fetch('http://localhost:5000/api/health');
const healthData = await healthResponse.json();
results.innerHTML += '<p>Health Check: ' + JSON.stringify(healthData) + '</p>';
// Test login endpoint
const loginResponse = await fetch('http://localhost:5000/api/login', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
username: 'gpass1979@gmail.com',
password: 'gpass1979'
})
});
const loginData = await loginResponse.json();
results.innerHTML += '<p>Login Test: ' + JSON.stringify(loginData) + '</p>';
} catch (error) {
results.innerHTML += '<p>Error: ' + error.message + '</p>';
}
}
testAuth();
</script>
</body>
</html>