TypeScript
const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: JSON.stringify({email: 'jsmith@example.com', password: '<string>', rememberMe: true}) }; fetch('http://localhost:8000/api/v1/session', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err));
{ "success": true, "data": { "user": { "id": "<string>", "email": "jsmith@example.com", "name": "<string>", "image": "<string>", "emailVerified": true, "createdAt": "2023-11-07T05:31:56Z", "role": "<string>" }, "session": { "token": "<string>", "expiresAt": "2023-11-07T05:31:56Z" } }, "meta": { "requestId": "<string>", "timestamp": "<string>" } }
Create a new session by authenticating with email and password
1
Login successful
true
Show child attributes
Was this page helpful?