discordOauth()
Makes "Login with Discord" simpler
Usage: discordOauth(client_id, client_secret, permissions)
To start, create a Discord application here.

The Client ID can be found under General Information, by the application name.

The Client Secret can be found under General Information, by the application name. Do not share this code.
The permissions are the permissions that the server needs. Separate these by a space. Example: "identify email connections guilds relationships.read"
I would recommend putting discordOauth() on a separate page than the login page. To activate the login, add ?action=login to the end of the URL. If discord and the user accept the request, it will redirect back to the page and the function will return results about the user. (Use print_r to print them). If the user denies the request or discord does not accept it, you will be sent back to the page and the function will return with "User denied the request.".
Last updated
Was this helpful?