curl --request GET \
--url https://api.example.com/api/usuarios/me{
"id": "<string>",
"persona_id": 123,
"role": "<string>",
"created_at": "<string>",
"persona": {
"id": 123,
"nombres": "<string>",
"apellidos": "<string>",
"telefono": "<string>",
"dni": "<string>",
"foto_url": "<string>"
}
}Retrieve the authenticated user profile and associated person data
curl --request GET \
--url https://api.example.com/api/usuarios/me{
"id": "<string>",
"persona_id": 123,
"role": "<string>",
"created_at": "<string>",
"persona": {
"id": 123,
"nombres": "<string>",
"apellidos": "<string>",
"telefono": "<string>",
"dni": "<string>",
"foto_url": "<string>"
}
}admin or asistente role.Authorization: Bearer <supabase-jwt-token>
admin or asistentecurl -X GET http://localhost:3000/api/usuarios/me \
-H "Authorization: Bearer YOUR_SUPABASE_JWT_TOKEN"
const response = await fetch('http://localhost:3000/api/usuarios/me', {
headers: {
'Authorization': `Bearer ${supabaseToken}`
}
});
const profile = await response.json();
{
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"persona_id": 5,
"role": "asistente",
"created_at": "2024-03-05T10:30:00.000Z",
"persona": {
"id": 5,
"nombres": "María",
"apellidos": "González",
"telefono": "+1234567890",
"dni": "12345678",
"foto_url": "https://example.com/photos/maria.jpg",
"created_at": "2024-03-01T08:00:00.000Z"
}
}
401 Unauthorized
{
"message": "Token requerido"
}
404 Not Found
{
"message": "Usuario no encontrado"
}
/home/daytona/workspace/source/src/routes/usuarios.routes.js:112