-
Notifications
You must be signed in to change notification settings - Fork 0
Login endpoint
Alvin Cheng edited this page Apr 23, 2023
·
3 revisions
The login endpoint is used to authenticate the user for Chill&chat, this endpoint will search the MongoDB database and find the user and compare the password. The endpoint will return a status '200' on success, '400' on incorrect user credentials, '401' on invalid API key or '500' on a server processing error. You can find the endpoint's source in /src/endpoints/login.ts. Furthermore, the endpoint will take 2 arguments including, 'username ' which is the username inputted from the user. And the self-explanatory 'password' argument takes the password given.
post("http://<URL>/api/login?key=<YOUR_API_KEY>", {
username: "<USERNAME>",
password: "<PASSWORD>",
})
.then((res) => {
console.log(res);
})
.catch((err) => {
console.error(err);
});- Home
- Login endpoint
- Block user endpoint
- Create room endpoint
- Delete user endpoint
- Get all rooms endpoint
- Get GIF endpoint
- Get messages endpoint
- Get public rooms endpoint
- Get user info endpoint
- Get users info endpoint (Deprecated)
- Join room endpoint
- Signup endpoint
- Report room endpoint
- Remove room endpoint
- Update description endpoint
- Follow user endpoint
- Unfollow user endpoint
- Update icon color endpoint
- Upload content endpoint
- Upload content endpoint (Deprecated)
- Verify client endpoint
- Upload token endpoint
- Chill&chat websockets
- Message socket
- Keyboard socket
- Delete message socket
- User content
- Final words&thoughts
- Run API