burhan-syed / troddit

A web client for Reddit with authenticated logins and a variety of browsing options

Home Page:https://www.troddit.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Login not working

neoestremi opened this issue · comments

I've been running troddit for a long time, but recently wasn't using it, anyway, I tried to use it and it wasn't working anymore, I nuked it, redeployed it, saw I had to authorize plausible.io in my DNS filters, everything works fine but I can't log in, no error in logs, no DNS requests blocked, if you could help me get it working again :) here are my env vars :

TZ=Europe/Paris
CLIENT_ID=[redacted]
CLIENT_SECRET=[redacted]
REDDIT_REDIRECT=https://reddit.domain.tld/api/auth/callback/reddit
NEXTAUTH_URL=https://reddit.domain.tld/ (tried using http://localhost:3000 but the reddit page is saying incorrect redirect if I do)
NEXTAUTH_SECRET=[generated with openssl rand -base64 32]

@neoestremi I'm unable to reproduce this with a fresh docker image of the project.
What exactly happens when you attempt the login flow?
Do you reach the Reddit OAuth request for permission page?
What happens when you click allow? Can you confirm there are no errors on the server logs when authentication fails?

I have same error

image

I have tried 
http://localhost:3002 and domain for NEXTAUTH_URL
Just to confirm REDDIT_REDIRECT is set to https://my.domain/api/auth/callback/reddit and if that is the case does NEXTAUTH_URL get set to https://my.domain/ also?
Would changing port break anything, I used 3002 instead of 3000 

EDIT: Fixed, dont know if related. I ended up usi port 3000, then https://my.domain/ for everyrhing url related.

On a side note: if I setup my instance public on my domain, could anyone just signup? I would hate to have a case where the api is slammed for my app

@neoestremi I'm unable to reproduce this with a fresh docker image of the project. What exactly happens when you attempt the login flow? Do you reach the Reddit OAuth request for permission page? What happens when you click allow? Can you confirm there are no errors on the server logs when authentication fails?

I'm redirected to reddit/s OAuth, I allow the application to connect, I'm redirected back to my instance of troddit but I'm not logged in.

0 error or log, only Listening on port 3000 url: http://reddit:3000

I have same error

image

I have tried 
http://localhost:3002 and domain for NEXTAUTH_URL
Just to confirm REDDIT_REDIRECT is set to https://my.domain/api/auth/callback/reddit and if that is the case does NEXTAUTH_URL get set to https://my.domain/ also?
Would changing port break anything, I used 3002 instead of 3000 

EDIT: Fixed, dont know if related. I ended up usi port 3000, then https://my.domain/ for everyrhing url related.

On a side note: if I setup my instance public on my domain, could anyone just signup? I would hate to have a case where the api is slammed for my app

I have same error

image

I have tried 
http://localhost:3002 and domain for NEXTAUTH_URL
Just to confirm REDDIT_REDIRECT is set to https://my.domain/api/auth/callback/reddit and if that is the case does NEXTAUTH_URL get set to https://my.domain/ also?
Would changing port break anything, I used 3002 instead of 3000 

EDIT: Fixed, dont know if related. I ended up usi port 3000, then https://my.domain/ for everyrhing url related.

On a side note: if I setup my instance public on my domain, could anyone just signup? I would hate to have a case where the api is slammed for my app

I have same error

image

I have tried 
http://localhost:3002 and domain for NEXTAUTH_URL
Just to confirm REDDIT_REDIRECT is set to https://my.domain/api/auth/callback/reddit and if that is the case does NEXTAUTH_URL get set to https://my.domain/ also?
Would changing port break anything, I used 3002 instead of 3000 

EDIT: Fixed, dont know if related. I ended up usi port 3000, then https://my.domain/ for everyrhing url related.

On a side note: if I setup my instance public on my domain, could anyone just signup? I would hate to have a case where the api is slammed for my app

just wanted to add I noticed when using the nextauth url keeping a / after your domain is important

docker-compose.yaml

I am using port 3200 and have a caddy server forwarding it via port 80/443 with ssl

name: troddit
services:
    troddit:
        container_name: troddit
        ports:
            - 3200:3000 
        environment:
            - CLIENT_ID=[redacted]
            - CLIENT_SECRET=[redacted]
            - REDDIT_REDIRECT=https://example.com/api/auth/callback/reddit
            - NEXTAUTH_SECRET=[redacted]
            - NEXTAUTH_URL=https://example.com/
            - SIGNING_PRIVATE_KEY=[redacted]
        image: bsyed/troddit