curl --request POST \
--url https://api.example.com/api/auth/login \
--header 'Content-Type: application/json' \
--data '
{
"username": "<string>",
"password": "<string>",
"totpCode": "<string>"
}
'{
"success": true,
"error": "<string>",
"details": {}
}Authenticate a user and create a new session
curl --request POST \
--url https://api.example.com/api/auth/login \
--header 'Content-Type: application/json' \
--data '
{
"username": "<string>",
"password": "<string>",
"totpCode": "<string>"
}
'{
"success": true,
"error": "<string>",
"details": {}
}Documentation Index
Fetch the complete documentation index at: https://mintlify.com/Crocantefinancial/crocante-pitch-frontend/llms.txt
Use this file to discover all available pages before exploring further.
crocante_session) that is used for subsequent authenticated requests.
The endpoint acts as a Backend-for-Frontend (BFF) proxy, forwarding credentials to the backend authentication service and storing the resulting access token in a secure, HTTP-only cookie.
{
"username": "user@example.com",
"password": "securePassword123",
"totpCode": "123456"
}
true on successful login{
"success": true
}
Set-Cookie header with the following attributes:
crocante_sessiontrue (prevents JavaScript access)true in production (HTTPS only)Strict (CSRF protection)/{
"error": "Invalid request",
"details": {
"formErrors": [],
"fieldErrors": {
"username": ["Username is required"]
}
}
}
{
"error": "Login failed"
}
{
"error": "Login failed"
}
/api/auth/loginimport { LoginService } from '@/services/api/auth/login-service';
try {
const result = await LoginService.login({
username: 'user@example.com',
password: 'securePassword123',
totpCode: '123456' // Optional, for 2FA
});
console.log('Login successful:', result.success);
// Session cookie is automatically stored by browser
} catch (error) {
console.error('Login failed:', error);
}
curl -X POST https://api.crocante.com/api/auth/login \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{
"username": "user@example.com",
"password": "securePassword123"
}' \
-c cookies.txt