mirror of
https://github.com/mastodon/mastodon.git
synced 2025-05-16 06:31:12 +00:00
Add support for public clients to OAuth Application creation - parameter name TBD
This commit is contained in:
parent
5c6ad1a0e5
commit
b21e7d8fdb
|
@ -16,14 +16,19 @@ class Api::V1::AppsController < Api::BaseController
|
||||||
redirect_uri: app_params[:redirect_uris],
|
redirect_uri: app_params[:redirect_uris],
|
||||||
scopes: app_scopes_or_default,
|
scopes: app_scopes_or_default,
|
||||||
website: app_params[:website],
|
website: app_params[:website],
|
||||||
|
confidential: app_confidential?,
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def app_confidential?
|
||||||
|
!app_params[:token_endpoint_auth_method] || app_params[:token_endpoint_auth_method] != 'none'
|
||||||
|
end
|
||||||
|
|
||||||
def app_scopes_or_default
|
def app_scopes_or_default
|
||||||
app_params[:scopes] || Doorkeeper.configuration.default_scopes
|
app_params[:scopes] || Doorkeeper.configuration.default_scopes
|
||||||
end
|
end
|
||||||
|
|
||||||
def app_params
|
def app_params
|
||||||
params.permit(:client_name, :scopes, :website, :redirect_uris, redirect_uris: [])
|
params.permit(:client_name, :scopes, :website, :token_endpoint_auth_method, :redirect_uris, redirect_uris: [])
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue
Block a user