This commit is contained in:
Emelia Smith 2024-04-26 18:07:05 +00:00 committed by GitHub
commit dfd463f681
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 14 additions and 2 deletions

View File

@ -24,6 +24,6 @@ class Api::V1::AppsController < Api::BaseController
end
def app_params
params.permit(:client_name, :redirect_uris, :scopes, :website)
params.permit(:client_name, :scopes, :website, :redirect_uris, redirect_uris: [])
end
end

View File

@ -1,7 +1,7 @@
# frozen_string_literal: true
class REST::ApplicationSerializer < ActiveModel::Serializer
attributes :id, :name, :website, :scopes, :redirect_uri,
attributes :id, :name, :website, :scopes, :redirect_uri, :redirect_uris,
:client_id, :client_secret
# NOTE: Deprecated in 4.3.0, needs to be removed in 5.0.0
@ -19,6 +19,18 @@ class REST::ApplicationSerializer < ActiveModel::Serializer
object.secret
end
def redirect_uri
# Doorkeeper stores the redirect_uri value as a newline delimeted list in
# the database, as we may have more than one redirect URI, return the first:
object.redirect_uri.split.first
end
def redirect_uris
# Doorkeeper stores the redirect_uri value as a newline delimeted list in
# the database:
object.redirect_uri.split
end
def website
object.website.presence
end