TheDarkun / Elevators

Fullstack .NET Project for SOČ
0 stars 0 forks source link

Store Discord Tokens #11

Open TheDarkun opened 7 months ago

TheDarkun commented 7 months ago

Store Discord Tokens

Proposal

Upon completion of task #8, we should implement database integration.

Details

When the user authorizes, the backend is able to retrieve this data:

{
  "access_token": "6qrZcUqja7812RVdnEKjpzOL4CvHBFG",
  "token_type": "Bearer",
  "expires_in": 604800,
  "refresh_token": "D43f5y0ahjqew82jZ4NViEr2YafMKhue",
  "scope": "identify"
}

It is necessary to securely store both the access_token and refresh_token. Encryption will be applied to ensure data safety. Let's store the expires_in too, just to check if the access_token expires. Utilizing the access_token, we can access crucial information from Discord, including server memberships for all users.