📊
Pre-made PHP Functions
  • Pre-made PHP Functions
  • Changelog
  • Functions
    • sth()
    • sthm()
    • sthms()
    • download()
    • doublehash()
    • triplehash()
    • getip()
    • getcloudflareip()
    • simpleHTML()
    • styledHTML()
    • source_code()
    • ssl_check()
    • memory_usage()
    • discordOauth()
    • full_url()
    • startsWith()
    • endsWith()
  • Credits
Powered by GitBook
On this page

Was this helpful?

  1. Functions

discordOauth()

Makes "Login with Discord" simpler

Previousmemory_usage()Nextfull_url()

Last updated 4 years ago

Was this helpful?

Usage: discordOauth(client_id, client_secret, permissions)

To start, create a Discord application .

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.".

here