shopify app proxy: send customer data or only customer ID

后端 未结 2 1864
别那么骄傲
别那么骄傲 2021-01-15 20:05

I need to get customer first and last names and email address for the server side logic.

As I see it there are 2 options:

  1. Form submit with the data in
2条回答
  •  余生分开走
    2021-01-15 20:36

    1. implies you will possibly receive garbage. The incoming data means nothing since a bot could fill in a form and submit.

    2. at least implies you have an actual logged in customer. If you have the ID you also have the email and name, from Liquid. If your Proxy call is from a script tag that has no access like that, you can send the customer ID from the secret customer ID cookie value, and yes, make an API call. That is not a big deal at all.

提交回复
热议问题