This is a simple dashboard to manage SupportMail.
- User clicks on the "Login with Discord" button.
- User is redirected to Discord's OAuth2 authorization page.
- User authorizes the application.
- Discord redirects back to the callback route with an authorization code.
- The application exchanges the authorization code for an access token.
- The application uses the access token to fetch user information from Discord's API.
- The application stores the user information in the database.
- The application creates a session cookie (JWT) with an expiration time (usually the time the access token is valid).
- The user is redirected to the dashboard page, where they can see their information and manage their support tickets.
- User GETs any route that is not in the list of public routes.
- The application checks if the user has a session cookie (JWT). (if not, redirect to login)
- The application checks if the session cookie is valid (not expired).
- The application checks if the user exists in the database.
- If the user exists and still has the tokens, return them.
- Fetch user data from Discord // Get from cache if available.
- Continue to the requested route.
Everything from above has to be satisfied before this can happen!
- Find user guilds (cache or fetch from Discord)
- Check if requested guild is in the list of cached guilds.
- If it is not in the list, return a 404 Not Found.
- Check for at least manager permissions for that guild.
- If the user does not have manager permissions, return a 403 Forbidden error.
- Continue to the requested route.
- User GETs the logout route.
- The application gets and deletes the tokens from the database (if found).
- The application revokes the access token (if found) and the refresh token (if found).
- The application deletes the session cookie (JWT).
- The user is redirected to the login page.
- custom_id: 100
- id: 0 <= 2_147_483_647
- ActionRow
- children: 5
- Button
- label: 80
- Container
- children: 10
- MediaGallery
- items: 10
- MediaGalleryItem
- description: 256
- Select
- placeholder: 150
- min_values: 0 <= len(options) <= 25
- max_values: 1 <= len(options) <= 25
- default_values: min_values <= max_values
- options: 25
- label: 100
- value: 100
- description: 100
- Section
- accessory: 1
- children: 3
- TextInput: 5
- label: 45
- placeholder: 100
- min_length: 0 <= 4000
- max_length: 1 <= 4000
- value/default: 4000
- TextDisplay
- content: accumulatively, max 4000
- Thumbnail
- description: 256