mirror of
https://github.com/we-promise/sure.git
synced 2026-09-03 05:41:18 +00:00
* fix(mcp): assign OAuth clients read_write scope * fix(mcp): default registered OAuth scope --------- Co-authored-by: Juan José Mata <juanjo.mata@gmail.com>
13 lines
395 B
Ruby
13 lines
395 B
Ruby
class Oauth::AuthorizationsController < Doorkeeper::AuthorizationsController
|
|
before_action :default_mcp_scope, only: [ :new, :create ]
|
|
|
|
private
|
|
|
|
def default_mcp_scope
|
|
return if params[:scope].present?
|
|
|
|
application = Doorkeeper::Application.find_by(uid: params[:client_id])
|
|
params[:scope] = "read_write" if application&.scopes.to_s.split == [ "read_write" ]
|
|
end
|
|
end
|