Code Monkey home page Code Monkey logo

Comments (8)

piercegearhart avatar piercegearhart commented on July 21, 2024 1

Oh, thank you. I forgot about that lol. Thanks for the quick response!

from discord-oauth2-php.

piercegearhart avatar piercegearhart commented on July 21, 2024 1

For sure, and thank you so much for the quick help, really means a lot.

from discord-oauth2-php.

Xwilarg avatar Xwilarg commented on July 21, 2024

Thanks for your bug report, I'll investigate that and keep in touch with you when I'll have more information

On a side note, your message was containing your application secret, please regenerate it on the Discord Developer page to avoid any problem

from discord-oauth2-php.

Xwilarg avatar Xwilarg commented on July 21, 2024

I tried to reproduce your issue but I don't encounter any problem

My example is hosted on https://test.zirk.eu/ and made out of one page called index.php.
image
index.php contains the following:

<?php

require __DIR__ . '/vendor/autoload.php';

use Xwilarg\Discord\OAuth2;

$oauth2 = new OAuth2("808406108631728139", "my_token", "https://test.zirk.eu");

if ($oauth2->isRedirected() === false) {
    $oauth2->startRedirection(['identify', 'connections', 'email', 'guilds']);
} else {
    $ok = $oauth2->loadToken();
    if ($ok !== true) {
        $oauth2->startRedirection(['identify', 'connections', 'email', 'guilds']);
    } else {
        $answer = $oauth2->getUserInformation();
        if (array_key_exists("code", $answer)) {
            exit("An error occured: " . $answer["message"]);
        } else {
            echo "Welcome " . $answer["username"] . "#" . $answer["discriminator"];
        }

        echo '<br/><br/>';
        $answer = $oauth2->getConnectionsInformation();
        if (array_key_exists("code", $answer)) {
            exit("An error occured: " . $answer["message"]);
        } else {
            foreach ($answer as $a) {
                echo $a["type"] . ': ' . $a["name"] . '<br/>';
            }
        }
    }
}

As you can see, if you click on the URL you have the auth page which then redirect you to the same page, displaying the informations

Do you see any difference with that you currently have?

from discord-oauth2-php.

piercegearhart avatar piercegearhart commented on July 21, 2024

I don't see a difference, no. I copied the code you provided above and replaced mine with it, and changed the redirect URL, Client ID and Token to mine and tried again, same issue. I moved the code from /account/discord/redirect to just the index file of netrx.piercegearhart.com and it worked... so it appears the issue has something to do with it being in a directory like that or something of the such?

from discord-oauth2-php.

Xwilarg avatar Xwilarg commented on July 21, 2024

Could you maybe replace the two2 $oauth2->startRedirection by a print and tell me which one is causing the issue?
If it's the second one, try to do a var_dump of $ok and see if there is any information inside

from discord-oauth2-php.

piercegearhart avatar piercegearhart commented on July 21, 2024

I found the issue.. I changed the redirect URL to have .php at the end and it worked.. so an issue on my end. I have it setup in my .htaccess to remove .php from php files which worked on my localhost, but not when I moved it to my VPS. If I try to go to the page with .php it just doesnt load, which I guess was also causing and issue with this.

from discord-oauth2-php.

Xwilarg avatar Xwilarg commented on July 21, 2024

Ah, well that's good to know, feel free to tell me if you encounter any other issue

from discord-oauth2-php.

Related Issues (4)

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.