Skip to content

armgit / spree

Public Imported from GitHub
0

Open Source Platform for DTC, B2B Commerce, Marketplaces & Omnichannel. REST APIs, TypeScript SDKs, and production-ready Next.js storefront. Self-host it. Own your data. No vendor lock-in. Zero platform fees.

Deprecate `Core::ControllerHelpers::Auth#current_oauth_token`

Damian Legawiec2afd7fcb4542
diff --git a/backend/engines/core/lib/spree/core/controller_helpers/auth.rb b/backend/engines/core/lib/spree/core/controller_helpers/auth.rb
index 21bdd3714d..7d78fc5011 100644
--- a/backend/engines/core/lib/spree/core/controller_helpers/auth.rb
+++ b/backend/engines/core/lib/spree/core/controller_helpers/auth.rb
@@ -21,6 +21,8 @@ module Spree
end
def current_oauth_token
+ Spree::Deprecation.warn('Spree::Current.oauth_token is deprecated and will be removed in Spree 5.5')
+
get_last_access_token = ->(user) { Spree::OauthAccessToken.active_for(user).where(expires_in: nil).last }
create_access_token = ->(user) { Spree::OauthAccessToken.create!(resource_owner: user) }
user = try_spree_current_user