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
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
28 Replies
Heya, we're seeing quite a few issues with nginx proxy manager
Could you share screenshots of your config please @David ?
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
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
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 BraveWhat is your NEXT_PUBLIC_BACKEND_URL set to?
And is SSL working ok now?
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
@Postiz please help @David
Yes, please help David
@Support @xcons May I have some help ?
What's your nginx proxy manager config look like please?
@xcons Is that the info you need ?
+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 ?
+1
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?
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 ?
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 ?
@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
@Support , @xcons : Can you please help here..
+1
Same issue as @David
{"message":"Cannot GET /auth/login","error":"Not Found","statusCode":404}
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:
Hi Alex.. is portainer-host.lan a public domain, or just on your local lan ?
Never mind.. just googled.. its a local lan domain..
Yes that's right. Maps to traffic in the 192.168.1.x range
I see.. my issue is with public domain.. cloudfare tunneling in to my machins on lan..
but thanks for sharing..
I'm seeing the same errors and behaviors despite the networking, which implies a code issue I think
I see.. btw.. my http:// localhost:5000 had worked just fine..
@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)
- 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)
@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?
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)
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!