Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't send request to one login when signing out after impersonation #10194

Merged
merged 1 commit into from
Jan 2, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/controllers/one_login_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def sign_out
reset_session

session[:one_login_error] = one_login_error
if OneLogin.bypass?
if OneLogin.bypass? || id_token.nil?
redirect_to candidate_interface_create_account_or_sign_in_path
else
# Go back to one login to sign out the user on their end as well
Expand Down
11 changes: 9 additions & 2 deletions spec/requests/one_login_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@
end
end

describe 'GET /auth/one-login/sign_out' do
describe 'GET /auth/one-login/sign-out' do
it 'redirects to one_login logout url' do
create(:candidate, email_address: '[email protected]')

Expand Down Expand Up @@ -162,9 +162,16 @@
expect(response).to redirect_to candidate_interface_create_account_or_sign_in_path
end
end

context 'session id_token is nil' do
it 'redirects to sign_in page' do
get auth_one_login_sign_out_path
expect(response).to redirect_to candidate_interface_create_account_or_sign_in_path
end
end
end

describe 'GET /auth/one-login/sign_out_complete' do
describe 'GET /auth/one-login/sign-out-complete' do
context 'when candidate has a different one login token than the one returned by one login' do
it 'redirects to logout_one_login_path and persists the session error message' do
candidate = create(:candidate, email_address: '[email protected]')
Expand Down
Loading