mirror of
https://github.com/mastodon/mastodon.git
synced 2025-05-11 20:21:10 +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],
|
||||
scopes: app_scopes_or_default,
|
||||
website: app_params[:website],
|
||||
confidential: app_confidential?,
|
||||
}
|
||||
end
|
||||
|
||||
def app_confidential?
|
||||
!app_params[:token_endpoint_auth_method] || app_params[:token_endpoint_auth_method] != 'none'
|
||||
end
|
||||
|
||||
def app_scopes_or_default
|
||||
app_params[:scopes] || Doorkeeper.configuration.default_scopes
|
||||
end
|
||||
|
||||
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
|
||||
|
|
Loading…
Reference in New Issue
Block a user