BlueFin / backend /test_auth3.js
vedanshmadan21's picture
Deploy Intelli-Credit to HuggingFace Spaces
7f6dd09
import axios from 'axios';
async function test() {
const email = 'login_test' + Date.now() + '@example.com';
const password = 'realpassword123!';
console.log("Signing up:", email);
try {
const signupRes = await axios.post('http://localhost:3001/api/auth/signup', { email, password });
console.log("Signup success!");
} catch (err) {
console.error("Signup error:", err.response?.data || err.message);
return;
}
console.log("\nLogging in:", email);
try {
const loginRes = await axios.post('http://localhost:3001/api/auth/login', { email, password });
console.log("Login success!");
} catch (err) {
console.error("Login error:", err.response?.data || err.message);
}
}
test();