Skip to content

Commit

Permalink
Enable new auth strategy as default from generator
Browse files Browse the repository at this point in the history
  • Loading branch information
zzooeeyy committed Apr 29, 2024
1 parent 6305192 commit 31c1a3e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ ShopifyApp.configure do |config|
config.scope = "<%= @scope %>" # Consult this page for more scope options:
# https://help.shopify.com/en/api/getting-started/authentication/oauth/scopes
config.embedded_app = <%= embedded_app? %>
config.unstable_new_embedded_auth_strategy = <%= embedded_app? %>

config.after_authenticate_job = false
config.api_version = "<%= @api_version %>"
config.shop_session_repository = 'Shop'
Expand Down
4 changes: 4 additions & 0 deletions test/generators/install_generator_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ class InstallGeneratorTest < Rails::Generators::TestCase
assert_match "config.secret = ENV.fetch('SHOPIFY_API_SECRET', '')", shopify_app
assert_match 'config.scope = "read_products"', shopify_app
assert_match "config.embedded_app = true", shopify_app
assert_match "config.unstable_new_embedded_auth_strategy = true", shopify_app
assert_match "config.api_version = \"#{ShopifyAPI::LATEST_SUPPORTED_ADMIN_VERSION}\"", shopify_app
assert_match "config.after_authenticate_job = false", shopify_app

Expand Down Expand Up @@ -65,6 +66,7 @@ class InstallGeneratorTest < Rails::Generators::TestCase
assert_match "config.secret = ENV.fetch('SHOPIFY_API_SECRET', '')", shopify_app
assert_match 'config.scope = "read_orders write_products"', shopify_app
assert_match "config.embedded_app = true", shopify_app
assert_match "config.unstable_new_embedded_auth_strategy = true", shopify_app
assert_match 'config.api_version = "unstable"', shopify_app
assert_match "config.shop_session_repository = 'Shop'", shopify_app
end
Expand All @@ -78,6 +80,7 @@ class InstallGeneratorTest < Rails::Generators::TestCase
assert_match "config.secret = ENV.fetch('SHOPIFY_API_SECRET', '')", shopify_app
assert_match 'config.scope = "read_orders write_products"', shopify_app
assert_match "config.embedded_app = true", shopify_app
assert_match "config.unstable_new_embedded_auth_strategy = true", shopify_app
assert_match "config.shop_session_repository = 'Shop'", shopify_app
end
end
Expand All @@ -86,6 +89,7 @@ class InstallGeneratorTest < Rails::Generators::TestCase
run_generator ["--embedded", "false"]
assert_file "config/initializers/shopify_app.rb" do |shopify_app|
assert_match "config.embedded_app = false", shopify_app
assert_match "config.unstable_new_embedded_auth_strategy = false", shopify_app
end
end

Expand Down

0 comments on commit 31c1a3e

Please sign in to comment.