Files
Harun CAN 58832e99d1
Backend Deploy 🚀 / build-and-deploy (push) Has been cancelled
main
2026-05-09 05:57:56 +02:00

20 lines
528 B
JavaScript

const axios = require('axios');
async function main() {
try {
const login = await axios.post('http://localhost:3000/api/auth/login', {
email: 'admin@contentgen.ai',
password: 'admin123'
});
const token = login.data.data.accessToken;
const res = await axios.get('http://localhost:3000/api/users/me', {
headers: { Authorization: `Bearer ${token}` }
});
console.log(JSON.stringify(res.data, null, 2));
} catch(e) {
console.error(e.response?.data || e.message);
}
}
main();