mirror of
https://github.com/KeyZox71/knl_meowscendence.git
synced 2025-12-31 21:56:41 +01:00
1005 B
1005 B
Login
Abailable endpoints:
- POST
/login - GET
/login/google - GET
/login/google/callback
Common return:
- 500 with response
{
"error": "Internal server error"
}
POST /login
Used to login
Input needed :
{
"user": "<string>",
"password": "<string>",
(optional)"token": "<2fa token>"
}
Can return:
- 200 with response and cookie in header
{
"msg": "Login successfully"
}
- 402 with response
{
"msg": "Please specify a 2fa token"
}
- 400 || 401 with response
{
"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
{
"error": "<corresponding error>"
}
- 200 with response and cookie in header
{
"msg": "Login successfully"
}