Skip to content

Commit

Permalink
spec(auth0): add login_hint spec on redirect
Browse files Browse the repository at this point in the history
  • Loading branch information
Radamés Roriz committed Mar 2, 2021
1 parent 5c2a62a commit a909e88
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions spec/omniauth/strategies/auth0_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,23 @@
expect(redirect_url).not_to have_query('connection')
end

it 'redirects to hosted login page with login_hint=example@mail.com' do
get 'auth/auth0?login_hint=example@mail.com'
expect(last_response.status).to eq(302)
redirect_url = last_response.headers['Location']
expect(redirect_url).to start_with('https://samples.auth0.com/authorize')
expect(redirect_url).to have_query('response_type', 'code')
expect(redirect_url).to have_query('state')
expect(redirect_url).to have_query('client_id')
expect(redirect_url).to have_query('redirect_uri')
expect(redirect_url).to have_query('login_hint', 'example@mail.com')
expect(redirect_url).not_to have_query('auth0Client')
expect(redirect_url).not_to have_query('connection')
expect(redirect_url).not_to have_query('connection_scope')
expect(redirect_url).not_to have_query('prompt')
expect(redirect_url).not_to have_query('screen_hint')
end

describe 'callback' do
let(:access_token) { 'access token' }
let(:expires_in) { 2000 }
Expand Down

0 comments on commit a909e88

Please sign in to comment.