scottyzen / woonuxt

Static e-commerce powered by WooCommerce & Nuxt
https://woonuxt.com
GNU General Public License v3.0
674 stars 185 forks source link

Unable to Login via Mobile Device tested in Samsung Browser and Safari #250

Closed anggerenn closed 1 month ago

anggerenn commented 1 month ago

Hi @scottyzen,

I found that after I deployed woonuxt app in netlify, I can't log in via my mobile device.

I was stuck in Login page (only showing the Logging you in text) and not redirected to My Account page. This is tested in Samsung Browser, Safari and Firefox. Only in Firefox I could log into my account via my mobile device.

I already tested using a fresh clone of woonuxt repository and woocommerce and I still have this issue

you can test it here https://flourishing-piroshki-bee44e.netlify.app/

Kindly need your advice how to solve this

alexookah commented 1 month ago

@anggerenn I believe this issue is similar to (https://github.com/scottyzen/woonuxt/issues/212#issuecomment-2337686463.

According to a Stack Overflow response on Safari not sending cookies even after setting SameSite=None; Secure, this behavior is due to an intended change in Safari. The "Prevent cross-site tracking" setting, which is enabled by default, causes all cross-site cookies to be rejected, regardless of the SameSite=None; Secure attribute, which other browsers would otherwise accept.

To resolve this, you need to connect your Netlify app with your custom domain and use both WordPress and Netlify under the same domain.

For example, if your domain is example.com, you can have your WordPress at admin.example.com and your Netlify Woonuxt frontend at example.com or staging.example.com.

In your case, I see your WordPress is at dev-qweqw.pantheonsite.io. You should connect your Netlify app to either pantheonsite.io or test.pantheonsite.io (or any other subdomain).

This way, Safari will accept the login cookie. 😊

anggerenn commented 1 month ago

hi @alexookah , to overcomm, using your advice I can fix the problem, thanks a bunch!