Create a session using username/email and password
curl --request POST \
--url https://api.acornops.dev/api/v1/auth/password/login \
--header 'Content-Type: application/json' \
--header 'x-csrf-token: <x-csrf-token>' \
--data '
{
"identifier": "dev",
"password": "devpass"
}
'const options = {
method: 'POST',
headers: {'x-csrf-token': '<x-csrf-token>', 'Content-Type': 'application/json'},
body: JSON.stringify({identifier: 'dev', password: 'devpass'})
};
fetch('https://api.acornops.dev/api/v1/auth/password/login', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"user": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"email": "jsmith@example.com",
"displayName": "<string>",
"emailVerified": true,
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
},
"status": "authenticated",
"verificationRequired": true
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"details": {}
}
}Auth and users
Create a session using username/email and password
Create a session using username/email and password
curl --request POST \
--url https://api.acornops.dev/api/v1/auth/password/login \
--header 'Content-Type: application/json' \
--header 'x-csrf-token: <x-csrf-token>' \
--data '
{
"identifier": "dev",
"password": "devpass"
}
'const options = {
method: 'POST',
headers: {'x-csrf-token': '<x-csrf-token>', 'Content-Type': 'application/json'},
body: JSON.stringify({identifier: 'dev', password: 'devpass'})
};
fetch('https://api.acornops.dev/api/v1/auth/password/login', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"user": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"email": "jsmith@example.com",
"displayName": "<string>",
"emailVerified": true,
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
},
"status": "authenticated",
"verificationRequired": true
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"retryable": true,
"details": {}
}
}Headers
CSRF token returned by /api/v1/auth/csrf and mirrored in the CSRF cookie.
Body
application/json