<base-url>/user
Returns a welcome message from the BioEntrust Auth server.
- Method:
GET
- URL:
user/home
-
200 OK
{ "new_data": "Welcome to BioEntrust Auth server" }
-
500 Internal Server Error
{ "status": "error", "message": "Error message" }
Returns a protected message from the BioEntrust Auth server. Requires JWT authentication.
- Method:
GET
- URL:
user/protected
-
200 OK
{ "new_data": "Protected data" }
-
401 Unauthorized
{ "status": "error", "message": "Unauthorized" }
-
500 Internal Server Error
{ "status": "error", "message": "Error message" }
Registers a new user and sends an OTP to the provided email for verification.
-
Method:
POST
-
URL:
/user/signup
-
Body: JSON
{ "first_name": "John", "last_name": "Doe", "email": "[email protected]", "password": "password123" }
-
200 OK
{ "otp_request_id": "some_unique_id", "response": "otp sent" }
-
400 Bad Request
{ "error": "Password should be more than 7 characters" }
-
409 Conflict
{ "error": "Email address already in use" }
Verifies the user's email by checking the provided OTP.
-
Method:
POST
-
URL:
/user/verify-email
-
Body: JSON
{ "otp": "123456", "otp_request_id": "some_unique_id" }
-
200 OK
{ "message": "Logged In", "token": { "access": "access_token", "refresh": "refresh_token" } }
-
401 Unauthorized
{ "error": "Signup Failed" }
Authenticates a user and returns an access token and a refresh token.
-
Method:
POST
-
URL:
/user/signin
-
Body: JSON
{ "email": "[email protected]", "password": "password123" }
-
200 OK
{ "message": "Logged In", "token": { "access": "access_token", "refresh": "refresh_token" } }
-
401 Unauthorized
{ "error": "Invalid login credentials" }
Verifies the user's phone number by checking the provided SMS OTP.
-
Method:
POST
-
URL:
/user/verify-sms
-
Body: JSON
{ "app_id": 09876, "otp": "123456", "otp_request_id": "some_unique_id" }
-
200 OK
{ "message": "Phone number verified" }
-
401 Unauthorized
{ "error": "Verification failed" }
Signs out the user by revoking the access and refresh tokens.
- Method:
DELETE
- URL:
/user/signout
- Required Bearer Authentication (refresh-token)
-
200 OK
{ "message": "Signed out successfully" }
Refreshes the access token using the refresh token.
- Method:
GET
- URL:
/user/refresh
- Requires Bearer Authentication (refresh-token)
-
200 OK
{ "token": { "access": "yada-yada-yada-yada-yada-yada-yada-yada-yada-yada-" } }
Sends a password reset link to the user's email.
-
Method:
POST
-
URL:
/user/forgot-password
-
Body: JSON
{ "email": "[email protected]", "password": "1234567890" }
-
200 OK
{ "message": "Password reset link sent" }
Resets the user's password using the provided token.
-
Method:
POST
-
URL:
/auth/reset-password
-
Body: JSON
-
Requires Bearer Authentication (access-token)
{ "email": "[email protected]", "password": "newpassword123" }
-
200 OK
{ "message": "Password reset successfully" }
-
400 Bad Request
{ "error": "Invalid token or password" }