Skip to content

Commit

Permalink
Check Redirect URI to allow custom schemas for apps
Browse files Browse the repository at this point in the history
  • Loading branch information
nbulaj committed Feb 15, 2018
1 parent 540cb18 commit 73c9549
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions spec/validators/redirect_uri_validator_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,16 @@
expect(subject).to be_valid
end

# Most mobile and desktop operating systems allow apps to register a custom URL
# scheme that will launch the app when a URL with that scheme is visited from
# the system browser.
#
# @see https://www.oauth.com/oauth2-servers/redirect-uris/redirect-uris-native-apps/
it 'is valid when the uri is custom native URI' do
subject.redirect_uri = 'myapp://callback'
expect(subject).to be_valid
end

it 'is valid when the uri has a query parameter' do
subject.redirect_uri = 'https://example.com/abcd?xyz=123'
expect(subject).to be_valid
Expand Down

0 comments on commit 73c9549

Please sign in to comment.