Comments (28)
Could you two share your two env entiries I showed above, here?
from stub.
Trying to use this app and hit the same roadblocks @NViviers is having. Unfortunately setting it as a different port (or really any port) makes Discord / GH not accept the Callback URI (although that might be because I'm running it over a domain and not localhost.)
Additionally, emails don't seem to send. I'm using a poste.io setup and I believe that since it allows multiple domains the SMTP URI doesn't work at all. But that's a nodemailer / next-auth.js issue and I don't think much can be done about it sadly.
On a (somewhat) related note, why are logins required? Shouldn't the user be allowed to use it without an account? It's a link shortener.
from stub.
Not sure how this isn't working, but I've mainly used Discord OAuth in development. Email has worked on instances before, just don't know why it doesn't work locally.
from stub.
Now that I've gotten Discord auth working, I'm able to say for sure that the other auth methods have the same problem. They all seem to do the login process but then send me back to the login page
from stub.
Huh weird, I've tested e-mail and Discord in my own environment and they work fine. What environment are you testing this on?
from stub.
on my setup i have the admin panel on admin.lio.tld
and the actual shortener on lio.tld
and everything has been working fine for me
Do you have the Callback URL for NextAuth set to your Admin Panel?
These are mine and it works fine
edit:
I mainly use Email Login, but recently added Github Login as well, and both of those are working as they should
from stub.
I'm also facing this issue, even with different OAuth providers (Discord and GitHub), the same happens.
from stub.
Could you two share your two env entiries I showed above, here?
Sure, they are the same as provided by default, however.
# The callback URL for authentication purposes (ex. "https://example.com")
NEXTAUTH_URL=http://localhost:3000
# The domain of the app
APP_HOSTNAME=localhost:3000
from stub.
Did you guys fill in the NEXTAUTH_SECRET
? That would also impact authentication.
Also @himbolion the APP_HOSTNAME
should've been the same domain as the admin instance (which is redundant from NEXTAUTH_URL
but whatever) It's a little important since that domain gets assigned when using cookies.
from stub.
I've got the exact same entries as Codeize, I have filled in NEXTAUTH_SECRET
through the link provided in the line above that entry.
from stub.
I've got the exact same entries as Codeize, I have filled in
NEXTAUTH_SECRET
through the link provided in the line above that entry.
Same here, I did what was asked of me in the example env file.
from stub.
Huh weird, I've tested e-mail and Discord in my own environment and they work fine. What environment are you testing this on?
Seems I never answered this. I'm running Pop!_OS here with Docker 20.10.20 and I'm visiting the project in Firefox
from stub.
I can try running this on Windows as well as Ubuntu, although Ubuntu will be running ARM instead of x86
from stub.
Weird, it's been running well for me on my Debian Server through Docker, with all those entries filled as well.
Are you using the latest Docker Image, if running through docker?
Or are you using the latest version of the Repo if you've just cloned the Repo?
from stub.
Yes, I am running the latest Docker image provided. I have also tried a fresh install of it, fresh .env file with all the entries filled in.
from stub.
Well the only thing I can think of is if there were errors while next-auth was handling authentication. Maybe the redirect URI was mistyped when using the Discord OAuth. Does the query string of the login URL change at all? Maybe something like error=LoginFailed
or something. You can also inspect the requests from your browser and see if that leads to anything.
from stub.
I've triple checked the OAuth redirect URI, it's definitely correct. The query string doesn't change. localhost:3000
sends me to localhost:3000/login
, after logging in through Discord I get sent back to exactly localhost:3000/login
again.
There are no errors in the console, the network tab doesn't show anything weird either.
from stub.
Huh, I guess browser settings could impact it? I don't even know, I have the same environment variables and it works fine over localhost and on a separate server.
from stub.
I've tried on both Firefox and Chrome, both have the same result. Simply send me back to the login page
from stub.
Huh, I guess browser settings could impact it? I don't even know, I have the same environment variables and it works fine over localhost and on a separate server.
Are you able to send us your .env file? I want to compare to see what difference there is, we're running through docker so there shouldn't be any problems there. I've tried both Chrome and Firefox (Don't think the problem is there either)
from stub.
I can grab mine in a bit, since I recently moved servers and it still works fine for me on the new server
from stub.
Same issue here
Using docker compose on Ubuntu 20, didn't change anything but env variables. Tried with both magic link (didn't receive email) and github (redirected back to login)
from stub.
my compose.yml looks like this
my secrets are censored , for obvious reasons. But this has been working fine on my old and now my new server
from stub.
This might a stupid question, but in the logs I see both ports 3000
and 3001
open, I'm visiting localhost:3000/login
for the login, I've tried with Discord authentication to redirect to both localhost:3000/api/auth/callback/discord
and localhost:3001
, the first one gives me a Invalid OAuth2 redirect_uri : You can now close this tab.
error message from Discord (Without it redirecting me or anything yet), the second actually redirects me to http://localhost:3001/api/auth/callback/discord?code=...&state=...
and displays Not Found
. Am I using this incorrectly?
from stub.
Yeah, that's the problem, the redirect URI port needs to be at 3000
since that's where the admin panel is at. You need to add localhost:3000/api/auth/callback/discord
as a redirect URI in your Discord app page for Discord OAuth to function.
from stub.
Yeah, that's the problem, the redirect URI port needs to be at
3000
since that's where the admin panel is at. You need to addlocalhost:3000/api/auth/callback/discord
as a redirect URI in your Discord app page for Discord OAuth to function.
I've tried both, I was just asking to see which one it should be. Now that I tested again, after confirming it to be set to http://localhost:3000/api/auth/callback/discord
it's still doing the same thing
from stub.
Hello,
Do you solve your problem ? Because i have exactly the same issue.
After click on the link received by mail, i will redirect to /login again and again.
I set super-admin from cli after i installed the yarn package for dev, but no change.
/app $ yarn manage set-superadmin
yarn run v1.22.19
$ tsx scripts/cli.ts set-superadmin
Enter the email of the user you want to set as a superadmin.
โ E-mail ยท [email protected]
Updating superadmin user ... OK
Done in 6.72s.
Do you have any idea to solve the problem ?
Thanks
from stub.
Same issue with the Github OAuth, redirect to /login again and again.
Thanks @Snazzah
from stub.
Related Issues (16)
- Dependency Dashboard
- User Settings
- Make links case-insensitive option per-project HOT 2
- iOS/Android targeting
- Appreciation! HOT 1
- Login emails not being sent
- QR Code Modal
- UTM Source/Medium Tracking
- Project Domain HOT 3
- Useage without docker compose
- 401 unauthorized when creating new project HOT 1
- Better documentation for other auth methods HOT 2
- Login still redirect to login page with discord HOT 2
- Login problem not solved. HOT 1
- Signin with email and discord redirect to login page:: deployed to vercel. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from stub.