P
Postiz3mo ago
Support

Ticket: Sign In/Up Redirection and Authentication Issues

@David Just created a ticket
Question: I'm having sign in/sign up issues: When I try signin up: - the first time just redirects me to the sign up page - the other times will mention "Email already exists" When I try signin in: - "Invalid user name or password" if the mail is not registered - Redirect to sign in page if I've signed up the email before
Attempted: - without https - on Ubuntu laptop localhost (it works!) - removing nginx proxy manager and passing by nginx (not working)
Working On: Ubuntu server with Nginx proxy manager and https
Using Postiz On: Docker-compose
Take it from here @Postiz
36 Replies
xcons
xcons3mo ago
Heya, we're seeing quite a few issues with nginx proxy manager Could you share screenshots of your config please @David ?
David
David3mo ago
Hey James, thank you for the response. I've tried without it and I still got the same result. Please see attached a screenshot of the config. I've just changed the address, the rest is as initially mentioned on https://docs.postiz.com/installation/docker-compose
Postiz Documentation
Docker Compose - Postiz Docs
Postiz - Open source social media scheduling tool
No description
xcons
xcons3mo ago
So that all generally looks fine If you try and login, does the page just look like it refreshes, with no error messages? The most likely cause of this is the cookie isn't being set - can you show me a screenshot of your browser cookies? Also, in the browser console, the output of; window.isSecureContext and document.cookie
David
David3mo ago
The page indeed refreshes with no error message (Edge, brave, chrome). Only on Firefox am I getting in the console: {"message":"Cannot GET /auth/login","error":"Not Found","statusCode":404} window.isSecureContext returns true on all browsers. document.cookie returns "" on Firefox and the attached image on Brave
Brave document.cookie
Brave cookies
xcons
xcons3mo ago
What is your NEXT_PUBLIC_BACKEND_URL set to? And is SSL working ok now?
David
David3mo ago
MAIN_URL = https://domain.com FRONTEND_URL = https://domain.com NEXT_PUBLIC_BACKEND_URL = https://domain.com/api SSL is working fine as before, my other apps are doing fine Container logs shows nothing as well
Support
SupportOP3mo ago
@Postiz please help @David
David
David3mo ago
Yes, please help David @Support @xcons May I have some help ?
xcons
xcons3mo ago
What's your nginx proxy manager config look like please?
David
David3mo ago
No description
No description
No description
David
David3mo ago
@xcons Is that the info you need ?
ukro
ukro3mo ago
+1 same :-X i have in console POST https://postiz.xxxxxx.duckdns.org/api/auth/register 400 NPM logs: [10/Dec/2024:16:23:59 +0000] - 200 200 - GET https postiz.XXXXXX.duckdns.org "/auth/login?_rsc=1rqwo" [Client 192.168.6.65] [Length 110] [Gzip -] [Sent-to postiz] "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36" "https://postiz.XXXXXX.duckdns.org/auth" [10/Dec/2024:16:24:23 +0000] - 400 400 - POST https postiz.XXXXXX.duckdns.org "/api/auth/register" [Client 192.168.6.65] [Length 35] [Gzip -] [Sent-to postiz] "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36" "https://postiz.XXXXXX.duckdns.org/auth" @xcons maybe we can check logs of the backend service on port 3000? node.js ,where are the outputs of common_1.Logger ?
Ketseum
Ketseum2mo ago
+1
nova
nova2mo ago
I was having a similar issue with a Tailscale domain name (xxx.tailxxx.ts.net), and it seemed to be because the cookie returned was only for the ts.net domain?
Rainbow
Rainbow2mo ago
Hi @David , I have the exact same issue. My domain also has three levels , and my cookie value is also empty after I try to log in. Format : https://post.xxxx.com.de
When I tried to singin via localhost before I enabled domain name ( using clouldflare tunnels ) , the login had worked. @nova did you manage to solve your issue ?
nova
nova2mo ago
@Rainbow unfortunately not, I found the piece of code responsible for picking the cooking domain but didn’t have time to see if there was a way around it or to try a forked build
Rainbow
Rainbow2mo ago
@Support , @xcons : Can you please help here..
IronmanMK7
IronmanMK72mo ago
+1 Same issue as @David {"message":"Cannot GET /auth/login","error":"Not Found","statusCode":404}
Alex
Alex2mo ago
I have the same issue using the standard docker compose from https://docs.postiz.com/installation/docker-compose#network-requirements window.isSecureContext is FALSE document.cookie yields a string starting with csrfXXXXXXXXXXXX When I click login I can see a request to http://portainer-host.lan:5000/auth?_rsc=1pz1r that returns 200 OK - but I remain on the sign in page and can't access any other pages (i.e. the root address / redirects to /auth The only modificaitions I've made to the docker-compose file are below:
MAIN_URL: "http://portainer-host.lan"
FRONTEND_URL: "http://portainer-host.lan:5000"
NEXT_PUBLIC_BACKEND_URL: "http://portainer-host.lan:5000/api"
JWT_SECRET: "123435"
MAIN_URL: "http://portainer-host.lan"
FRONTEND_URL: "http://portainer-host.lan:5000"
NEXT_PUBLIC_BACKEND_URL: "http://portainer-host.lan:5000/api"
JWT_SECRET: "123435"
Postiz Documentation
Docker Compose - Postiz Docs
Postiz - Open source social media scheduling tool
Rainbow
Rainbow2mo ago
Hi Alex.. is portainer-host.lan a public domain, or just on your local lan ? Never mind.. just googled.. its a local lan domain..
Alex
Alex2mo ago
Yes that's right. Maps to traffic in the 192.168.1.x range
Rainbow
Rainbow2mo ago
I see.. my issue is with public domain.. cloudfare tunneling in to my machins on lan.. but thanks for sharing..
Alex
Alex2mo ago
I'm seeing the same errors and behaviors despite the networking, which implies a code issue I think
Rainbow
Rainbow2mo ago
I see.. btw.. my http:// localhost:5000 had worked just fine..
Wuzzup™
Wuzzup™2mo ago
@David @ukro FWIW - I too have been trying to get my local domain registered as a multi level domain on duckdns.org (postiz.XYZ.duckdns.org) working.
- The cookie is trying to be set with Domain=.duckdns.org which is being rejected by the browser due to the domain at this level being on the Public Suffix List (https://publicsuffix.org/).
- If the Cookie was to be set at Domain=.XYZ.duckdns.org it will work but that would require code changes in the app.
This probably means any multi level (or single level) domain that has its base domain in the Public Suffix List will be rejected and the login will seem to just refresh the page. 🤷‍♂️ I see there is a list in the code that seems to cater for these kind of domains, duckdns.org is not one of them at this time... (https://github.com/gitroomhq/postiz-app/blob/92b8feb0938c7ef41df9d4408277271e2de395be/libraries/helpers/src/subdomain/all.two.level.subdomain.ts#L1)
ukro
ukro2mo ago
@Wuzzup™ Omg that must be it ❤️ ! so if i will create just http on localhost and then port forward to local lan, would all the providers work? or i need https?
Rainbow
Rainbow2mo ago
Hi @Nevo David : Can you please add "com.de" to the file .. which I think is used for two level domains.. (https://github.com/gitroomhq/postiz-app/blob/92b8feb0938c7ef41df9d4408277271e2de395be/libraries/helpers/src/subdomain/all.two.level.subdomain.ts#L1)
PastaGringo
PastaGringo2mo ago
Hi everyone! Just to let you know I succeed to configure postiz with nginx proxy manager (Cloudflare DNS cert) 🔥 I don't know if some of you still have issues but I can help if needed!
Rainbow
Rainbow4w ago
Hi,, what comain were you using was it .com ?
Doron Katz
Doron Katz4w ago
What was the fix
Brotherperson
Brotherperson4w ago
@egelhaus this van be closed
egelhaus
egelhaus4w ago
/close-ticket bruh Uhh I think the Bots offline @Support
Brotherperson
Brotherperson4w ago
🥲
egelhaus
egelhaus4w ago
@Nevo David
Rainbow
Rainbow3w ago
@Brotherperson / @Nevo David : No, even after added in .com.de, the auth didnt work .. So some other issue
Support
SupportOP3w ago
This thread is now closed! Feel free to open a new one if you need help

Did you find this page helpful?