I tested google OAuth sign-in on localhost, and it did work as expected, but when deployed the backend and storefront (https), something weird occurs...
As the process goes: Google login screen, prompts to select account, then after selecting a google account, starts loading, creates user at backend (I checked it's there) and then redirects success to storefront with access_token in the url params as expected.
But when trying to navigate to Account-page (/account), loads back the login screen. It turned out that storefront didn't set the jwt_cookie after the redirect.. no errors/info on either client/backend. I tried to log the access_token from headers in storefront, and showed undefined, whereas in localhost it is there!
if i take the access_token and put it in the browser cookies it works
Also, I tried the default manual account sign-up and login, and it works as expected
deployed logs:
token from getMedusaHeaders undefined
headers from getCustomer { next: { tags: [ 'customer' ] }, authorization: '' }
Localhost logs:
token from getMedusaHeaders eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJkb21haW4iOiJ...
headers from getCustomer {
next: { tags: [ 'customer' ] },
authorization: 'Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJkb21haW4iOiJ...
}
Also tried switching ENV from development to production, didn't change anything
Does anyone know what might be the case here?