Get Current User

Endpoint: GET /auth/getme

Description: Get current authenticated user's details.

Headers:

  • Authorization: Bearer <token> (optional if using cookies)

Cookies:

  • accessToken (required if not using Authorization header)

Success Response (200):

{
  "success": true,
  "data": {
    "_id": "507f1f77bcf86cd799439011",
    "username": "johndoe",
    "name": "John Doe",
    "email": "john@example.com",
    "avatar": "default.jpg",
    "createdAt": "2023-01-01T00:00:00.000Z",
    "updatedAt": "2023-01-01T00:00:00.000Z"
  }
}

Error Responses:

401 Unauthorized:

{
  "success": false,
  "message": "You are not logged in. Please log in to get access."
}

404 Not Found:

{
  "success": false,
  "message": "User not found"
}
Updated on