Skip to main content

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.

  1. head to https://discord.com/developers/applications
  2. Click the "New Application" button in the top right
  3. Enter a name in the modal and press "Create"
  4. Once created, it will redirect you to the application.
  5. Head to the "OAuth2" section
  6. Copy the "Client ID" and "Client Secret" (these will be used later)

Adding redirects

We'll now add the redirects required for OAuth.

  1. Make sure you're in the "Oauth2" section
  2. Click the button "Add Redirect"
  3. 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 or http://99.99.99.99:8080/v1/auth/discord/callback
  4. Click the "Save Changes" button at the bottom of the page.

Update .env

Once everything is correctly setup above, we can continue.

  1. Open the .env file
  2. Add the following lines
note

This must be placed at the bottom of SnailyCAD's .env file

DISCORD_CLIENT_ID=""
DISCORD_CLIENT_SECRET=""
  1. Enter the copied values from earlier in the corresponding name
  2. Correctly update the .env file: How to update the .env file correctly
  3. Restart the entire CAD.

Was this page helpful?