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.

Allow oAuth apps to use Doorkeeper

Damian Legawiec4c04f56687fd
diff --git a/api/config/initializers/doorkeeper.rb b/api/config/initializers/doorkeeper.rb
index 2b1f6b49ca..f387a1eaea 100644
--- a/api/config/initializers/doorkeeper.rb
+++ b/api/config/initializers/doorkeeper.rb
@@ -24,11 +24,15 @@ Doorkeeper.configure do
current_spree_user&.has_spree_role?('admin') || redirect_to(routes.root_url)
end
- grant_flows %w(password)
+ grant_flows %w[password client_credentials]
+
+ allow_blank_redirect_uri true
handle_auth_errors :raise
access_token_methods :from_bearer_authorization, :from_access_token_param
+
+ optional_scopes :admin, :write, :read
end
Doorkeeper::AccessGrant.class_eval do