roman-koshchei / fit-knu-tournament

FIT KNU Tournament 2023 best project

Home Page:https://fit-knu-tournament.onrender.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

QuasarSoft Auth

Authentication service made by QuasarSoft team for FIT KNU Tournament 2023

API tasks

  • 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
  • Google

UI tasks

  • Home/login form/page
  • Registartion page
  • Account info
  • Confirm account delete page
  • Change password page
  • Change email page
  • Google

API reference

To work with API you can look at:

Registration

Endpoint: POST /api/auth/register

Request

{
  email: user@exmple.com,
  password: your_password,
  confirmPassword: your_password
}

Response

{
  ??
}

Posible status codes:

  • 200 OK: Registration was successful.
  • 400 Bad Request: Data is unvaliable.
  • 500 Internal Server Error: Registration failed.

Login

Endpoint: POST /api/auth/login

Request

{
  email: user@example.com,
  password: your_password
}

Response

{
  ??
}

Possible status codes:

  • 200 OK: Succesful login.
  • 401 Unauthorized: Incorrect credentials

Check

Endpoint: GET /api/auth/check

Request

Accepts no request, using the cookie header

Response

{
  ??
}

Possible status codes:

  • 200 OK: Token is valid
  • 401 Unauthorized: Token is invalid

Me

Endpoint: GET /api/account/me

Request:

Accepts no request, using the cookie header

Response

{
  ??
}

Possible status codes:

  • 200 OK: Token is valid, and user information returned.
  • 401 Unauthorized: Token is invalid.

Change Password

Endpoint: PUT /api/account/password

Request

{
  oldPassword: your_old_password,
  newPassword: your_new_password
}

Response

{
  
}

Possible status code:

  • 200 OK: Successful password change.
  • 401 Unauthorized: Invalid old password.

Change Email

Endpoint: PUT /api/account/email

Request

{
  email: new_email@gmail.com
}

Response

{
  ??
}

Possible status codes:

  • 200 OK: Successful email change.
  • 401 Unauthorized: Invalid token.

Delete User

Endpoint: DELETE /api/account

Request

Accepts no request, using the cookie header

Response

{
  ??  
}

Possible status codes:

  • 200 OK: Successful user deletion.
  • 401 Unauthorized: Invalid password.

Google Auth

Endpoint: POST /api/auth/google

Request

{
  ??
}

Response

{
  ??
}

Possible status codes:

  • 200 OK: Successful Google authentication
  • 401 Unauthorized: Invalid Google access token

About

FIT KNU Tournament 2023 best project

https://fit-knu-tournament.onrender.com

License:MIT License


Languages

Language:C# 90.2%Language:HTML 8.6%Language:Dockerfile 0.9%Language:JavaScript 0.3%