Skip to content

Login with Discord #556

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

Open
theCowBoiCoder opened this issue Apr 17, 2025 · 6 comments
Open

Login with Discord #556

theCowBoiCoder opened this issue Apr 17, 2025 · 6 comments
Labels
bug Something isn't working

Comments

@theCowBoiCoder
Copy link

What were you trying to do?

I am trying to login with discord. When I hit the link i just get a white screen:

What happened?

I get a white screen

How to reproduce the bug

NA

Debug Output

TypeError: Cannot read properties of undefined (reading 'getCurrentWindow')
    at O (web.004ca8beee73a46f.js:12:4747150)

Which operating systems have you seen this occur on?

No response

Notes

I am not sure the process to fix.

@theCowBoiCoder theCowBoiCoder added the bug Something isn't working label Apr 17, 2025
@gwleuverink
Copy link
Contributor

Hi @theCowBoiCoder, Do you mean you're visiting the discord url from your browser? Or are you doing something inside your NativePHP app?

@theCowBoiCoder
Copy link
Author

This was inside the application.

@gwleuverink
Copy link
Contributor

My guess is whatever discord is doing does not work within a electron window.

Maybe it'll work if you open the url using Shell::openExternal($url);

@theCowBoiCoder
Copy link
Author

this did work, but how will handle the callback?

@gwleuverink
Copy link
Contributor

Am I correct in assuming you are trying oauth?

You might be able to use a deep link to the app as a callback url. Not all oauth providers accept this however

You can also spin up the php built in web server from a child process and redirect there. You have to make sure to validate the request coming in though, and maybe even exit the process when you don't need it

We have ideas for adding the latter in the framework in the future 👌

@theCowBoiCoder
Copy link
Author

theCowBoiCoder commented Apr 21, 2025

So i am using Socialite with Auth in Laravel but using discord to authenticate: Discord
But how discord works is that you login then it uses a callback with a access token.

Let me see how i can do it another way.
Just seeing if its possible with this solution.!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants