Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/harshalw2003/BidAuc/llms.txt

Use this file to discover all available pages before exploring further.

To sign in to an existing BidAuc account, first request an OTP for your phone number using POST /user/generateOtp, then submit that OTP here along with your phone number. The server validates the OTP, locates your account, and issues a fresh JWT stored in an httpOnly cookie for the duration of your session.

Endpoint

POST /user/login
No authentication is required for this endpoint.

Request body

phoneNumber
string
required
The 10-digit phone number associated with your BidAuc account.
otp
string
required
The one-time password sent to the phone number. In development this is always "123456".

Example request

# Step 1: Request OTP
curl -X POST http://localhost:5000/user/generateOtp \
  -H "Content-Type: application/json" \
  -d '{"phoneNumber": "9876543210"}'

# Step 2: Log in
curl -X POST http://localhost:5000/user/login \
  -H "Content-Type: application/json" \
  -c cookies.txt \
  -d '{
    "phoneNumber": "9876543210",
    "otp": "123456"
  }'

Response

Success — 200 OK

{
  "success": true,
  "message": "User logged in successfully",
  "jwtToken": "<jwt>"
}
success
boolean
true when the user was authenticated without errors.
message
string
Confirmation that the login succeeded.
jwtToken
string
Newly issued JWT for this session. Also written to the token cookie.

Errors

User not found
{
  "success": false,
  "message": "User not found"
}
Invalid or expired OTP — 400 Bad Request
{
  "message": "Invalid or expired OTP"
}
The server writes the JWT to an httpOnly cookie named token. Browsers include this cookie automatically on all subsequent requests to the same origin. When using curl, save the cookie with -c cookies.txt and replay it with -b cookies.txt on authenticated requests.

Build docs developers (and LLMs) love