-
-
Notifications
You must be signed in to change notification settings - Fork 321
Can't log in to admin on Chrome & Safari - possible CloudFlare cookie issue? #596
Comments
Is there any solution to this? |
Posting a response from @adrien2p on this issue after he had been running with different server configurations:
This might not resolve your issue, but thought I'd post it as it sheds some light on what could be the culprit. In the meantime, we'll investigate it further. |
Thanks for your reply Oliver, I think since we don't have a stable solution yet, we will seek to fix the problem, or wait for additional information about the problem. For me only works with firefox and production with Static IP and no secure https connection (though haven't tried with https in production). |
@olivermrbl yeah, thanks for the response (and Adrien). I'll look into my CloudFlare setup and try and get it working but for now I don't have much time so I'll just be using Firefox until I can investigate properly. |
I am not using cloud flare but have the same issue. Firefox works |
Here is a complementary information to my previous research
|
Deploying to self-managed server is giving the same result. Though there should be a way to allow cross-site from medusa. |
So, basically this repository is unsuable within cloud environment ? |
Same issue! Instant login / logout. I suspect it's due to cookies too. My environment: |
@SaadBazaz node environment should be on production, jwt_secret should be set, and of course to not forget to add the domain in CORS. This worked for me |
Node environment and JWT on which project? Backend or Admin Panel? |
Api backend |
Worked perfectly for me. Now localhost:7000 and cloud deployment (Vercel) are working. Thanks! |
I've got an issue where when I try to log in to the admin section on Chrome and Safari. The authentication call goes through and it redirects to admin from the login, but then I get a 401 from the
auth
,store
andusers
routes and I get redirected back to the login page. This doesn't happen on Firefox.I don't get any useful output from Medusa when the login attempt happens, just the return of the 401. In Chrome's response headers for set-cookie, there's a warning and it says
My
NODE_ENV=production
so it should be being set to none, but that isn't happening (both Secure and SameSite have no value). I can manually set Secure and SameSite and this then allows login, but it causes other issues from my storefront. Plus it's not a very satisfying conclusion.I'm running medusa at a subdomain through CloudFlare using a proxied A record, so this stackoverflow issue seems to be close to my problem, but the only solution there is already how things are set up here i.e. we're using
app.set("trust proxy", 1)
. The admin is on Netlify at a netlify.app domain.Also I'm not sure if this should actually be a
medusajs/medusa
issue, rather than admin as it seems that my problem is with the cookie that's being set there, but it's presenting as an admin issue so I'm posting here for now.The text was updated successfully, but these errors were encountered: