-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathtest_trace.js
More file actions
27 lines (24 loc) · 953 Bytes
/
Copy pathtest_trace.js
File metadata and controls
27 lines (24 loc) · 953 Bytes
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
async function extractError() {
const email = `test_9999@example.com`;
// Register first to ensure account exists
await fetch('https://cortexcrew-timecure-2.onrender.com/api/auth/register', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ username: "tester", email, password: "password123" })
});
// Login that crashes
const res = await fetch('https://cortexcrew-timecure-2.onrender.com/api/auth/login', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ email, password: "password123" })
});
const text = await res.text();
const preStart = text.indexOf('<pre>');
const preEnd = text.indexOf('</pre>');
if (preStart !== -1) {
console.log("TRACE START\n" + text.substring(preStart + 5, preEnd) + "\nTRACE END");
} else {
console.log("NO TRACE, Status: " + res.status + ", Body: " + text);
}
}
extractError();