FROM CACHE - en_header

Unable to log into customer account when using shopify theme serve

Solved
Allan-EP
Shopify Partner
11 0 23

Using the CLI command shopify theme serve I'm unable to log into a customer account to be able to preview/modify those templates. My guess is there's some kind of authentication/cookie issue since it's at http://127.0.0.1:9292/ but this is a significant road block for using the CLI for development. Has anyone run into this and found a fix?

Accepted Solution (1)

Accepted Solutions
drakedev
Shopify Partner
622 133 186

This is an accepted solution.

Dev team just released Shopify CLI 2.3.0 that should solve the reported issue (#1480)

Follow this guide to upgrade your version.

If my answer was helpful click Like to say thanks
If the problem is solved remember to click Accept Solution
Shopify/Shopify Plus custom development: You can hire me for simple and/or complex tasks.

View solution in original post

Replies 21 (21)
drakedev
Shopify Partner
622 133 186

Hi @Allan-EP 

do you use a staff account or partner account access to the client store?

Did you try to logout

shopify logout

and login again?

shopify login

Any errors? Can you try  to login to the specific store?

shopify login [--store=STORE]
If my answer was helpful click Like to say thanks
If the problem is solved remember to click Accept Solution
Shopify/Shopify Plus custom development: You can hire me for simple and/or complex tasks.
Rebeccajk440
New Member
1 0 0
Allan-EP
Shopify Partner
11 0 23

@drakedev The CLI store login is working fine for syncing changes using my partner account. What I'm referring to is logging into a user's account area on the front at /account/login while using

 

shopify theme serve

To get around this, I ended up pushing to the theme after each change, but that's pretty annoying compared to live reload or themekit's watcher. 

 

brendamarienyc
Shopify Partner
3 0 4

I just encountered this issue as well. I cannot log in to the store as a customer with an account from http://127.0.0.1:9292 which is generated from Shopify CLI with the command "shopify theme serve".  I tried a few different stores and different browsers with the same problem. This means I can't work on any development for features related to the customer object which is a big blocker! Can anyone help?

brendamarienyc
Shopify Partner
3 0 4

I found a good enough work around for this. You can preview the development theme while you are working on it using the link provided in the terminal after you run "shopify theme serve" under the heading "Share this theme preview". It doesn't hot reload the code changes on save like the local url, but it will show the updates on page refresh.

pepibumur
Shopify Staff
Shopify Staff
5 0 2

Hi!

I'm Pedro from Shopify,

First of all, apologies for the inconvenience caused by this. We were able to reproduce the issue and we are looking into it.
I'll get back to you with a solution so that you can iterate on your themes smoothly.

drakedev
Shopify Partner
622 133 186

This is an accepted solution.

Dev team just released Shopify CLI 2.3.0 that should solve the reported issue (#1480)

Follow this guide to upgrade your version.

If my answer was helpful click Like to say thanks
If the problem is solved remember to click Accept Solution
Shopify/Shopify Plus custom development: You can hire me for simple and/or complex tasks.
Allan-EP
Shopify Partner
11 0 23

Just updated and tested - works!

lyonsun
Tourist
4 0 2

Hi,

It seems the problem still exists if the "Enable Google reCAPTCHA on login, create account and password recovery pages" setting is on. When I disable that, it works well then.

Ogdila
Shopify Partner
28 0 8

I still have this issue. Would you please kindly tell me if you sorted this out? Thank you!!!

pepibumur
Shopify Staff
Shopify Staff
5 0 2

Hi @Ogdila, and apologies for the inconvenience.
Would you mind sharing more details about the error you are encountering? Does the CLI throw any error that might shed some light to understand the underlying error better?

Ogdila
Shopify Partner
28 0 8

Thanks, @pepibumur.

I did not receive an error.

I set up the CLI on my theme and started the development by typing "Shopify.theme.serve", then I can start editing my theme with all the hot reload and other CLI features locally.

The CLI serves the theme on  http://127.0.0.1:9292/, and all is good. However, when I want to work on the customer account template files locally, I go to the "login" button and try to log in "as a customer." The page redirects to the reCAPTCHA page, and no matter how many times I submit the reCAPTCHA, it refreshes the same page.

So I disabled the reCAPTCHA in my store settings and tried again. With the reCAPTCHA disabled, the login page refreshes itself instead of logging me in as a customer, so I cannot edit the account template pages locally.

It might be because of the "HTTP" that is not secured or because it's running on localhost. That, I am not sure.

pepibumur
Shopify Staff
Shopify Staff
5 0 2

Hi again,
Thanks for the detailed steps. May I ask what version of the CLI are you using? You can get it by running `shopify version`. In case you are not running the latest, 2.6.3, which was released yesterday, I'd recommend updating and trying again.

Ogdila
Shopify Partner
28 0 8

@pepibumur  I already tested  2.6.3 this morning, no change. I was thrilled when I saw three updates were pushed out the same night, and hoping that it may have this issue resolve, but it ain't. 

So what would be the root of my issue? Any idea?

pepibumur
Shopify Staff
Shopify Staff
5 0 2

Unfortunately, I can't pinpoint what the issue might be yet. Could you run the CLI but prefixing the command with `DEBUG=1` to see if more log verbosity sheds more light?.

Eben2
Tourist
4 0 2

Can confirm that logging in with reCAPTCHA it is still an issue on 2.6.5

Ogdila
Shopify Partner
28 0 8
Paul_vd_Dool
Shopify Partner
89 6 82

I can concur this is still an issue for Shopify CLI version 2.7.4

 

When on localhost:9292 and you try to access the account area of your shop you're prompted to login. When logging in you get a reCaptcha on localhost:9292/challenge. After submitting the reCaptcha you're redirected to the actual store address my-shop-slug.myshopify.com/challenge and have to do it again.

 

You can work around it though by disabling Google reCaptcha for the account page.

1. Go to the Admin page for your (development) store

2. Go to Online Store > Preferences

3. Scroll down to the 'Spam protection' section

4. Uncheck checkbox for "Enable Google reCAPTCHA on login, create account and password recovery pages"

 

This is a suitable workaround for me as it's a development store.

Doppelganger - Managing duplicate user accounts