diff --git a/CHANGELOG.md b/CHANGELOG.md index 48c54999d..fe71d86b6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ Note: For changes to the API, see https://shopify.dev/changelog?filter=api ## Unreleased - [#1183](https://github.com/Shopify/shopify-api-ruby/pull/1189) Added string array support for fields parameter in Webhook::Registry +- [#1205](https://github.com/Shopify/shopify-api-ruby/pull/1206) Fixes the issue of empty cookie sessions when using embedded mode. ## 13.1.0 diff --git a/lib/shopify_api/auth/oauth.rb b/lib/shopify_api/auth/oauth.rb index 66bdb6728..9c75d4865 100644 --- a/lib/shopify_api/auth/oauth.rb +++ b/lib/shopify_api/auth/oauth.rb @@ -81,17 +81,10 @@ def validate_auth_callback(cookies:, auth_query:) session = create_new_session(session_params, auth_query.shop) - cookie = if Context.embedded? - SessionCookie.new( - value: "", - expires: Time.now, - ) - else - SessionCookie.new( - value: session.id, - expires: session.online? ? session.expires : nil, - ) - end + cookie = SessionCookie.new( + value: session.id, + expires: session.online? ? session.expires : nil, + ) { session: session, cookie: cookie } end