mirror of
https://github.com/KeyZox71/knl_meowscendence.git
synced 2025-10-14 02:54:44 +02:00
「📝」 doc(auth): should be complete
This commit is contained in:
@ -1,6 +1,65 @@
|
||||
# Login
|
||||
|
||||
Abailable endpoints:
|
||||
- `/login`
|
||||
- `/login/google`
|
||||
- `/login/google/callback`
|
||||
- POST `/login`
|
||||
- GET `/login/google`
|
||||
- GET `/login/google/callback`
|
||||
|
||||
Common return:
|
||||
- 500 with response
|
||||
```json
|
||||
{
|
||||
"error": "Internal server error"
|
||||
}
|
||||
```
|
||||
|
||||
## POST `/login`
|
||||
|
||||
Used to login
|
||||
|
||||
Input needed :
|
||||
```json
|
||||
{
|
||||
"user": "<string>",
|
||||
"password": "<string>"
|
||||
}
|
||||
```
|
||||
|
||||
Can return:
|
||||
- 200 with response and cookie in header
|
||||
```json
|
||||
{
|
||||
"msg": "Login successfully"
|
||||
}
|
||||
```
|
||||
- 400 with response
|
||||
```json
|
||||
{
|
||||
"error": "<corresponding error>"
|
||||
}
|
||||
```
|
||||
|
||||
## GET `/login/google`
|
||||
|
||||
Used to redirect the user to the login page for google auth
|
||||
|
||||
Always return:
|
||||
- redirect to the google auth url
|
||||
|
||||
## GET `/login/google/callback`
|
||||
|
||||
Used to get the callback from google and confirm the login
|
||||
|
||||
Can return:
|
||||
- 400 with response
|
||||
```json
|
||||
{
|
||||
"error": "<corresponding error>"
|
||||
}
|
||||
```
|
||||
- 200 with response and cookie in header
|
||||
```json
|
||||
{
|
||||
"msg": "Login successfully"
|
||||
}
|
||||
```
|
||||
|
Reference in New Issue
Block a user