# マルチパスログイン後の挙動について

**URL:** <https://community.shopify.com/t/topic/283403>\
**Category:** 技術的なQ＆A\
**Created:** [January 9, 2024, 6:17am UTC](https://community.shopify.com/t/topic/283403 "2024-01-09T06:17:23Z")\
**Posts on this page:** 3\
**Page:** 1

## AI-generated summary

マルチパスログイン完了後のリダイレクト先ページの制御方法についての質問と解決。

**質問内容:**
- マルチパスログイン完了後、アカウントページへの遷移をフロント側で制御できるか
- 公式ドキュメントには該当する記述が見当たらなかった

**解決方法:**
- JSONペイロード内の **return_to** フィールドで任意のページへのリダイレクトを制御可能
- 例: `"return_to": "http://yourstore.com/some_specific_site"` で遷移先を指定
- マルチパス以外からの顧客ログインについても、フォーム内で制御できる方法が提示された

**結果:**
質問者は解決し、感謝の意を表明して完了。

<div class="post-metadata">

**Author:** ![r-irisawa](https://avatars.discourse-cdn.com/v4/letter/r/3be4f8/32.png) [@r-irisawa](https://community.shopify.com/u/r-irisawa)\
**Post date:** [January 9, 2024, 6:17am UTC](https://community.shopify.com/t/topic/283403/1 "2024-01-09T06:17:23Z")

</div>

[https://shopifyshopify.dev/docs/api/multipass#step-6-redirect-your-customer-to-your-shopify-store](https://shopifyshopify.dev/docs/api/multipass#step-6-redirect-your-customer-to-your-shopify-store)

↑で

```auto
/account/login/multipass/insert_token_here

```

にリダイレクトが完了することでログインが完了しアカウントページへ遷移しますが、

このアカウントページへの遷移をフロント側で制御することは可能でしょうか？

※公式のドキュメントにもそのような記述が見当たらなかったので

実現したいことは、マルチパスログイン完了後に任意のページへとリダイレクトさせたいです。

よろしくお願いいたします。

---

<div class="post-metadata">

**Author:** ![NIIGAKI\_HYUGA](https://avatars.discourse-cdn.com/v4/letter/n/f05b48/32.png) [@NIIGAKI\_HYUGA](https://community.shopify.com/u/NIIGAKI_HYUGA)\
**Post date:** [January 11, 2024, 1:41pm UTC](https://community.shopify.com/t/topic/283403/2 "2024-01-11T13:41:07Z")

</div>

@r-irisawa

初めまして。新垣です。

任意のページへのリダイレクトはjsonペイロード内の **return\_to** フィールドで制御できます。

```markup
// example containing some oprional fields
{
  "email": "nicpotts@example.com",
  "created_at": "2013-04-11T15:16:23-04:00",

  "first_name": "Nic",
  "last_name": "Potts",
  "tag_string": "canadian, premium",

  "identifier": "nic123",
  "remote_ip": "107.20.160.121",
  "return_to": "http://yourstore.com/some_specific_site", // ここで遷移先を指定

  "addresses": [{
    "address1": "123 Oak St",
    "city": "Ottawa",
    "country": "Canada",
    "first_name": "Nic",
    "last_name": "Potts",
    "phone": "555-1212",
    "province": "Ontario",
    "zip": "123 ABC",
    "province_code": "ON",
    "country_code": "CA",
    "default": true
  }]
}

```

multipass以外からの顧客ログインは、下記のようにして制御できるそうです。

```markup
{% form 'customer_login' %}
...
  
...
{% endform %}

```

以上、参考になりましたら幸いです。

---

<div class="post-metadata">

**Author:** ![r-irisawa](https://avatars.discourse-cdn.com/v4/letter/r/3be4f8/32.png) [@r-irisawa](https://community.shopify.com/u/r-irisawa)\
**Post date:** [January 12, 2024, 7:28am UTC](https://community.shopify.com/t/topic/283403/3 "2024-01-12T07:28:26Z")

</div>

@NIIGAKI_HYUGA 様

ありがとうございます！

とても助かりました！
