Retain existing weird behaviour regarding multiple redirect_uri values

This commit is contained in:
Emelia Smith 2024-05-07 23:50:37 +02:00
parent d8cc3f36e5
commit e35590fcb9
No known key found for this signature in database
2 changed files with 3 additions and 7 deletions

View File

@ -20,11 +20,7 @@ class REST::ApplicationSerializer < ActiveModel::Serializer
end
# We should consider this property deprecated for 4.3.0
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
delegate :redirect_uri, to: :object
def redirect_uris
# Doorkeeper stores the redirect_uri value as a newline delimeted list in

View File

@ -140,7 +140,7 @@ RSpec.describe 'Apps' do
body = body_as_json
expect(body[:redirect_uri]).to eq 'https://redirect1.example/'
expect(body[:redirect_uri]).to eq redirect_uris
expect(body[:redirect_uris]).to eq redirect_uris.split
end
end
@ -160,7 +160,7 @@ RSpec.describe 'Apps' do
body = body_as_json
expect(body[:redirect_uri]).to eq 'https://redirect1.example/'
expect(body[:redirect_uri]).to eq redirect_uris.join "\n"
expect(body[:redirect_uris]).to eq redirect_uris
end
end