GithubHelp home page GithubHelp logo

markisdev / discordoauth Goto Github PK

View Code? Open in Web Editor NEW
213.0 213.0 56.0 2.84 MB

A simple, and easy to use, PHP implementation of a Discord OAuth2 login flow. Implements a "Login with Discord" button on your site. Use this repo to build your very own Discord Dashboard! ๐Ÿš€

License: MIT License

PHP 100.00%
discord discord-oauth oauth2

discordoauth's Introduction

Hey, I'm Rijuth ๐Ÿ‘‹

Linkedin Badge Discord Badge Hashnode Badge Mindflux Badge BuyMeACoffee Badge

Hey there! I'm currently pursuing my bachelors degree in CSE from CMR Institute of Technology, Bengaluru.
I'm extremely passionate about technology and love building products! Currently, I'm a full-stack developer with a keen interest in web3.
Other than that, I enjoy writing a lot - I write technical content here and on quirky topics at my personal blog here.

Feel free to reach me, I'm always up for a fun conversation!

๐Ÿ’ช Click here for my skills

Languages:

Backend frameworks:

Frontend frameworks:

Databases:

๐Ÿš€ Click here for my blogs
Mindflux Hashnode
Exploring Confirmaton Bias Building ML-powered cross-platform apps with Flutter and Google's ML Kit!
The Paradox of Choice Develop your own GitHub README game!
Intellectual stimulation is your enemy! Firebase Authentication with GetX - Google Sign-in
Be grateful if you're lonely! Understanding Diffie-Hellman Key Exchange
Click here for more! โšก Click here for more! โšก

๐ŸŽฒ Join my community Mastermind game!

๐Ÿ† Recent user with winning move is @MarkisDev ๐ŸŽ‰

๐Ÿ“‹ Click here for the rules

  • The objective of the game is to find the correct sequence of colors chosen by the computer
  • The computer will always choose unique colors, it will not repeat any color
  • When each row of the board is filled, the computer will give you two hints
  • It will tell you the number of colors which are present in the code
  • It will also tell you the number of colors which are present in the correct position as well
  • Eg: Computer chose the sequence : White Blue Orange Purple
  • User guessed the squence : Blue Orange Green Purple
  • Correct position = Purple and Correct color = Blue, Orange
Position : 0 Color : 0

To make a move, click on one of the colors from below ๐Ÿ‘‡

โฐ Most recent moves

Pssst! The code chosen by computer is stored in board.json with base64 encoding ๐Ÿ‘€

discordoauth's People

Contributors

duncte123 avatar f-o avatar kylefardy avatar lil-pandaa avatar markisdev avatar rishabmenon avatar stwxdev avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

discordoauth's Issues

License

This is an awesome piece of code that made things a lot easier for my website. I saw the copyright header at the top of discord.php, and I was just wondering what license this work falls under.
If there is no license, someone can put your code in their website with this header removed, and you would not get credit for your work. On the other hand, legally, not having a license automatically puts your work as all rights reserved copyright, which means that anyone modifying and redistributing the code would be doing so illegally.
I assume this is not what you intend, so maybe it's a good idea to add a license to this project.

Feature request: Guild Member object

I use this script in my website, and I want to check how long ago a user joined my server.
Looking at the Discord API, that information is accessible via the Guild Member object.
I attempted to add a function for get Guild Member based on the existing get_user function:

# A function to get user information within a guild | (identify scope)
function get_guild_member($guildid)
{
    $url = $GLOBALS['base_url'] . "/api/guilds/" . $guildid . "/members/" . $_SESSION['user_id'];
    $headers = array('Content-Type: application/x-www-form-urlencoded', 'Authorization: Bearer ' . $_SESSION['access_token']);
    $curl = curl_init();
    curl_setopt($curl, CURLOPT_URL, $url);
    curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
    $response = curl_exec($curl);
    curl_close($curl);
    $results = json_decode($response, true);
    $_SESSION['nick'] = $results['nick'];
    $_SESSION['user_guild_avatar'] = $results['avatar'];
    $_SESSION['roles'] = $results['roles'];
    $_SESSION['joined_at'] = $results['joined_at'];
    $_SESSION['deaf'] = $results['deaf'];
    $_SESSION['mute'] = $results['mute'];
    $_SESSION['permissions'] = $results['permissions'];
}

I didn't test any of the other values, but the joined_at one I wanted was empty, so I did something wrong.
Do you have any idea what I may have done wrong here? It would be excellent if this could be in the official script.

Thank you

Hey I wanted to take a moment to say you rock dude. This script was absolutely perfect for me. You did all of the heavy lifting and made it so updating the code for my own use was easy as could be. Thank you so much for this.

Invalid Oauth2 redirect_uri

I might have messed something up, but I believe it should work... I am trying to integrate this into my website but I get "Invalid Oauth2 redirect_uri" from discord when it tries to redirect.. Any help?

$_SESSION['user'] is NULL

Greetings, Great Scriptlet!
I've run into a issue where the $_SESSION['user'] returns null.

I've used the profile-card example. Please Advise.

Webhooks

I think it would be a good feature if all the things we request from the discord api are displayed in a webhook!

Feature request and bug fix

Bug fix:
the /includes/oauth-login-widget.php file needs to be changed on line 28
old
'redirect_uri' => site_url( rest_get_url_prefix() . '/discord/callback', 'http' )
new
'redirect_uri' => site_url( rest_get_url_prefix() . '/discord/callback', 'https' )

Feature request:
Add guilds.join option to make the application join the user to the guild

Persistent bug:
After manually applying the fix above, login and user creation was successful but it did not redirect afterwards back to the site, Just stopped at

siteurl.com/wp-json/discord/callback?code=auth-token-here

had to be done by navigating to the site again.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.