🎉」 init: started writing doc for auth api

This commit is contained in:
2025-09-01 19:00:47 +02:00
parent 2942fccf0a
commit 4c4b9ca5ef
3 changed files with 58 additions and 0 deletions

0
doc/auth/2fa.md Normal file
View File

6
doc/auth/login.md Normal file
View File

@ -0,0 +1,6 @@
# Login
Abailable endpoints:
- `/login`
- `/login/google`
- `/login/google/callback`

52
doc/auth/register.md Normal file
View File

@ -0,0 +1,52 @@
# Register
Available endpoints:
- `/register`
- `/register/google`
- `/register/google/callback`
Common return:
- 500 with response
```json
{
"error": "Internal server error"
}
```
## `/register`
Input needed :
```json
{
"user": "<string>",
"password": "<string>"
}
```
Can return:
- 200 with response and cookie in header
```json
{
"msg": "Register successfully"
}
```
- 400 with response
```json
{
"error": "<corresponding error>"
}
```
## `/register/google`
Does not take input
Always return:
- redirect to the google auth url
## `/register/google/callback`
inputs are filled by google
Can return:
- 400 with response