Skip to content
This repository has been archived by the owner on Feb 28, 2024. It is now read-only.

Commit

Permalink
Fix OmniAuth CSRF regression test
Browse files Browse the repository at this point in the history
OmniAuth now rescues the InvalidAuthenticityToken error, so we have to
test that the redirect to GitHub doesn't happen instead (without a CSRF
token, the user is redirected to users/omniauth_callbacks#failure, which
redirects to the root path).
  • Loading branch information
rjpaskin committed May 15, 2023
1 parent 67edf08 commit bd2c5c3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions spec/request/omniauth_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@
end

it 'requires CSRF token for initial OmniAuth endpoint' do
expect {
post user_github_omniauth_authorize_path
}.to raise_error(ActionController::InvalidAuthenticityToken)
post user_github_omniauth_authorize_path

expect(response).not_to redirect_to(/github\.com/)
end
end
end
Expand Down

0 comments on commit bd2c5c3

Please sign in to comment.