discord dashboard and discord js combo
What i normally do is, i got a protect middleware that runs on each request.
What does the middleware do?
But that means running the server as well as bot in same process. What do you guys do?
What does the middleware do?
- it checks if JWT is present in cookie
- if jwt is valid
- gets user id from jwt then make request to database to get document with access token
- then make request to discord api /@me endpoint to validate the access token is still valid or not.
- protect middleware
- make request to api to check if he has certain roles
- make request to api to show all roles, another request to show all channels
- some database requests to get some data
But that means running the server as well as bot in same process. What do you guys do?