-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest-real-signup.js
More file actions
60 lines (50 loc) · 1.43 KB
/
Copy pathtest-real-signup.js
File metadata and controls
60 lines (50 loc) · 1.43 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
// Test the real signup with your exact payload
const http = require('http');
async function testRealSignup() {
const testData = JSON.stringify({
"email": "abhay.talreja+test@gmail.com",
"password": "Test@1234",
"firstName": "Abhay",
"lastName": "Talreja",
"organizationName": "Axe"
});
const options = {
hostname: 'localhost',
port: 3010,
path: '/api/auth/signup',
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Content-Length': Buffer.byteLength(testData)
}
};
console.log('Testing signup with your exact payload...');
const req = http.request(options, (res) => {
console.log(`Status Code: ${res.statusCode}`);
let body = '';
res.on('data', (chunk) => {
body += chunk;
});
res.on('end', () => {
console.log('Response Body:', body);
try {
const json = JSON.parse(body);
console.log('Parsed Response:', JSON.stringify(json, null, 2));
if (json.organization) {
console.log('✅ SUCCESS: Organization "Axe" was created!');
} else {
console.log('❌ Organization creation failed');
}
} catch (e) {
console.log('Failed to parse as JSON');
}
});
});
req.on('error', (error) => {
console.error('Request error:', error);
});
req.write(testData);
req.end();
}
// Wait a bit for server to be ready
setTimeout(testRealSignup, 1000);