Authentication service made by QuasarSoft team for FIT KNU Tournament 2023
- Registration: POST email + pasword + confirm password -> return token
- Login: POST email + password -> return token
- Check: GET token -> ok if token valid
- ME: GET token -> email
- Change password: POST token + old password + new password + change user version +1
- Change email: POST token + email + change user version + 1
- Delete user: DELETE token + password
- Home/login form/page
- Registartion page
- Account info
- Confirm account delete page
- Change password page
- Change email page
To work with API you can look at:
- Swagger documentation on the website
- Markdown documentation API reference
Endpoint: POST /api/auth/register
{
email: user@exmple.com,
password: your_password,
confirmPassword: your_password
}
{
??
}
Posible status codes:
- 200 OK: Registration was successful.
- 400 Bad Request: Data is unvaliable.
- 500 Internal Server Error: Registration failed.
Endpoint: POST /api/auth/login
{
email: user@example.com,
password: your_password
}
{
??
}
Possible status codes:
- 200 OK: Succesful login.
- 401 Unauthorized: Incorrect credentials
Endpoint: GET /api/auth/check
Accepts no request, using the cookie header
{
??
}
Possible status codes:
- 200 OK: Token is valid
- 401 Unauthorized: Token is invalid
Endpoint: GET /api/account/me
Accepts no request, using the cookie header
{
??
}
Possible status codes:
- 200 OK: Token is valid, and user information returned.
- 401 Unauthorized: Token is invalid.
Endpoint: PUT /api/account/password
{
oldPassword: your_old_password,
newPassword: your_new_password
}
{
}
Possible status code:
- 200 OK: Successful password change.
- 401 Unauthorized: Invalid old password.
Endpoint: PUT /api/account/email
{
email: new_email@gmail.com
}
{
??
}
Possible status codes:
- 200 OK: Successful email change.
- 401 Unauthorized: Invalid token.
Endpoint: DELETE /api/account
Accepts no request, using the cookie header
{
??
}
Possible status codes:
- 200 OK: Successful user deletion.
- 401 Unauthorized: Invalid password.
Endpoint: POST /api/auth/google
{
??
}
{
??
}
Possible status codes:
- 200 OK: Successful Google authentication
- 401 Unauthorized: Invalid Google access token