Get Current User
Returns the current user’s profile based on their IP address. If the user doesn’t exist, a new user is automatically created.Authentication
The API automatically:- Extracts the client’s IP address from request headers
- Hashes the IP using SHA-256 with salt
"jefftube-salt" - Looks up or creates a user with this IP hash
- Generates a random username if creating a new user
Request
No parameters required. User identity is determined from IP address.Response
User’s unique UUID identifierExample:
"550e8400-e29b-41d4-a716-446655440000"Auto-generated username in format
@user-xxxxxx where x is a random alphanumeric characterExample: "@user-a7f3b2"Example Response
IP Hashing Details
Privacy Protection
For privacy, raw IP addresses are never stored. Instead:- Hashing Algorithm: SHA-256
- Salt:
"jefftube-salt"(concatenated with IP) - Output: 64-character hexadecimal hash
IP Detection Order
The API checks request headers in this order:x-forwarded-for- Takes first IP from comma-separated listx-real-ip- Direct IP header from proxy- Fallback -
127.0.0.1for local development
Username Generation
When creating a new user, the system generates a random username:- Format:
@user-followed by 6 random characters - Character set: Lowercase letters (a-z) and digits (0-9)
- Example:
@user-a7f3b2,@user-k9m4x1
Probability of Collision
With 36 possible characters (26 letters + 10 digits) and 6 positions:- Total combinations: 36^6 = 2,176,782,336
- Collision probability is extremely low
Usernames are not currently editable by users. They serve as display names throughout the application.
User Creation Flow
Notes
This endpoint has no authentication requirements and will always return a user object (existing or newly created).
All other API endpoints that require user context use the same IP-based identification mechanism internally via the
getOrCreateUser() helper function.