Open susansli opened 1 week ago
To use, send a Get request to /protected/User
eg.
const response = await fetch('http://localhost:3333/protected/User', {
method: 'GET',
credentials: 'include',
headers: {
'Content-Type': 'application/json',
}
});
if (response.ok) {
const data = await response.json();
const user = data.user;
document.getElementById('userDetails').innerHTML = `
User Updated Successfully!
<p><strong>ID:</strong> ${user._id}</p>
<p><strong>Email:</strong> ${user.email}</p>
<p><strong>First Name:</strong> ${user.firstName}</p>
<p><strong>Last Name:</strong> ${user.lastName}</p>
<p><strong>Balance:</strong> ${user.balance}</p>
`;
}
Story
As a system, we need to be able to fetch a user that is associated with an account.
Specifications
The flow should go something like:
Acceptance