# Authenticate user with Firebase token **POST /auth** Receives a Firebase ID token in the Authorization header (Bearer token). Verifies the token, checks if the user exists in the database based on Firebase UID. If the user exists, returns user data and a JWT for subsequent API calls. If the user doesn't exist, it implicitly creates the user based on the token and returns the new user data and a JWT. ## Servers - Local development server: http://localhost:3000/api/v1 (Local development server) - Production server: https://referspecs-backend.onrender.com/api/v1 (Production server) ## Parameters ## Responses ### 200 Authentication successful (User already exists) #### Body: application/json (object) - **success** (boolean) - **statusCode** (integer) - **message** (string) - **data** (object) ### 201 Authentication successful (New user implicitly registered) #### Body: application/json (object) - **success** (boolean) - **statusCode** (integer) - **message** (string) - **data** (object) ### 401 Unauthorized (Invalid or missing Firebase token) #### Body: application/json (object) - **success** (boolean) - **statusCode** (integer) - **message** (string) ### 404 User not found (Should not happen with implicit registration, but possible if DB check fails unexpectedly) #### Body: application/json (object) - **success** (boolean) - **statusCode** (integer) - **message** (string) ### 500 Internal Server Error #### Body: application/json (object) - **success** (boolean) - **statusCode** (integer) - **message** (string) [Powered by Bump.sh](https://bump.sh)