mirror of https://github.com/mastodon/mastodon
Retain existing weird behaviour regarding multiple redirect_uri values
This commit is contained in:
parent
d8cc3f36e5
commit
e35590fcb9
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue