Solved

Liquid variable form.errors just displayed in development store but not display in production store

ThangCQ
Shopify Partner
23 2 6

I code a login page in shopify use Liquid.

To display error, I use  {{ form.errors | default_errors }}

However, when I login without username and password, It just display error in development store. And in the production store, it's alway null. I test in Dawn theme, the same situation happen.

When I use {{ form | json}} to watch variable in detail, It's alway show {"password_needed":true,"errors":null} when I login without username and password.

I don't really understand what happen behind the sense.

Anyone meet this case and know solution, please share with me. Thank you in advance.

Accepted Solution (1)

ThangCQ
Shopify Partner
23 2 6

This is an accepted solution.

I've figured reason out. It's because I turn on Sign-in with Shop (Shop pay). It's will add a field in my login form which is Login_with_shop[analytics_trace_id] and redirect to login url with analytics_trace_id and error queries.

I guess if I login by Shop pay before and enable Sign-in with Shop, it will redirect me to url with query include error instead of liquid return error in variable.

And the solution:

- turn-off sign-in with shop (shouldn't but it work)

- interact login function with shop pay (harder - now I have know idea how to do it)

Some guesses from me. If anyone know exactly the reason or document relate to that, please let me know. Thank you a lot.

View solution in original post

Reply 1 (1)

ThangCQ
Shopify Partner
23 2 6

This is an accepted solution.

I've figured reason out. It's because I turn on Sign-in with Shop (Shop pay). It's will add a field in my login form which is Login_with_shop[analytics_trace_id] and redirect to login url with analytics_trace_id and error queries.

I guess if I login by Shop pay before and enable Sign-in with Shop, it will redirect me to url with query include error instead of liquid return error in variable.

And the solution:

- turn-off sign-in with shop (shouldn't but it work)

- interact login function with shop pay (harder - now I have know idea how to do it)

Some guesses from me. If anyone know exactly the reason or document relate to that, please let me know. Thank you a lot.