Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't login via sample index.php #2

Closed
zlyfer opened this issue Feb 8, 2021 · 1 comment
Closed

Can't login via sample index.php #2

zlyfer opened this issue Feb 8, 2021 · 1 comment

Comments

@zlyfer
Copy link

zlyfer commented Feb 8, 2021

Hey,
I am using PHP Slim and I embedded your sample index.php.
However it seems like that the authentification doesn't work.
I used an echo "hi"; and print_r($oauth2); to print where the page is stuck and it seems like the page never gets to the user informmation retrievement.

// ...
  if ($oauth2->isRedirected() === false) { // Did the client already logged in ?
        // The parameters can be a combination of the following: connections, email, identity or guilds
        // More information about it here: https://discordapp.com/developers/docs/topics/oauth2#shared-resources-oauth2-scopes
        // The others parameters are not available with this library
        $oauth2->startRedirection(['identify', 'guilds']);
        print_r($oauth2);
        echo "hi";
    } else {
// ...

Result is:

Xwilarg\Discord\OAuth2 Object ( [_clientId:Xwilarg\Discord\OAuth2:private] => xxxxxxxxxxxxxxxxxx [_secret:Xwilarg\Discord\OAuth2:private] => xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx [_redirectUrl:Xwilarg\Discord\OAuth2:private] => http://localhost:8090/ [_accessToken:Xwilarg\Discord\OAuth2:private] => ) hi
@zlyfer
Copy link
Author

zlyfer commented Feb 8, 2021

Nevermind. I am stupid.

@zlyfer zlyfer closed this as completed Feb 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant