-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest-signup-manual.js
More file actions
46 lines (37 loc) · 1.19 KB
/
Copy pathtest-signup-manual.js
File metadata and controls
46 lines (37 loc) · 1.19 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
44
45
46
// Manual test of signup API to debug organization creation
const fetch = require('node-fetch');
async function testSignup() {
console.log('Testing signup API...');
const testData = {
email: `test-${Date.now()}@example.com`,
password: 'TestPassword123!',
firstName: 'Test',
lastName: 'User',
organizationName: 'Acme Inc.'
};
console.log('Test data:', testData);
try {
const response = await fetch('http://localhost:3010/api/auth/signup', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify(testData)
});
console.log('Response status:', response.status);
console.log('Response headers:', Object.fromEntries(response.headers.entries()));
const result = await response.text();
console.log('Response body:', result);
// Try to parse as JSON
try {
const json = JSON.parse(result);
console.log('Parsed JSON:', JSON.stringify(json, null, 2));
} catch (e) {
console.log('Could not parse as JSON');
}
} catch (error) {
console.error('Error:', error);
}
}
// Wait a bit for server to start, then test
setTimeout(testSignup, 5000);