Skip to content

Commit

Permalink
Cookie value should stay consistent since embedded allows fallback
Browse files Browse the repository at this point in the history
  • Loading branch information
berniechiu committed Aug 29, 2023
1 parent 95a1847 commit 43ab21f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
- [#1206](https://github.com/Shopify/shopify-api-ruby/pull/1206) Fixes the issue of empty cookie sessions when using embedded mode.

## 13.1.0

Expand Down
15 changes: 4 additions & 11 deletions lib/shopify_api/auth/oauth.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 43ab21f

Please sign in to comment.