Discord Authentication
SnailyCADv4 supports Discord authentication. Below you'll find out how to get access to it.
Create Discord application
If you already have an application created in the Discord portal, you can skip this step.
- head to https://discord.com/developers/applications
- Click the "New Application" button in the top right
- Enter a name in the modal and press "Create"
- Once created, it will redirect you to the application.
- Head to the "OAuth2" section
- Copy the "Client ID" and "Client Secret" (these will be used later)
Adding redirects
We'll now add the redirects required for OAuth.
- Make sure you're in the "Oauth2" section
- Click the button "Add Redirect"
- Enter the IP/domain to your CAD's API including the following path:
/v1/auth/discord/callback
-> Example:http://api.example.com/v1/auth/discord/callback
orhttp://99.99.99.99:8080/v1/auth/discord/callback
- Click the "Save Changes" button at the bottom of the page.
Update .env
Once everything is correctly setup above, we can continue.
- Open the
.env
file - Add the following lines
note
This must be placed at the bottom of SnailyCAD's .env file
DISCORD_CLIENT_ID=""
DISCORD_CLIENT_SECRET=""
- Enter the copied values from earlier in the corresponding name
- Correctly update the .env file: How to update the .env file correctly
- Restart the entire CAD.