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

Authentication errors should redirect to /auth/failure (similar to #18) #19

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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 examples/rails-todo-list-app/config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@

# This is where we are redirected if OmniAuth fails to authenticate the user.
# user
match '/auth/:provider/failure', to: redirect('/'), via: [:get, :post]
match '/auth/failure', to: redirect('/'), via: [:get, :post]
end
2 changes: 1 addition & 1 deletion examples/sinatra-multiple-providers-app/app.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
end

%w(get post).each do |method|
send(method, '/auth/:provider/failure') do
send(method, '/auth/failure') do
"Aw shucks, we couldn't verify your identity!"
end
end
2 changes: 1 addition & 1 deletion lib/omniauth/strategies/azure_activedirectory.rb
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def request_phase
# credentials at the authorization endpoint.
def callback_phase
error = request.params['error_reason'] || request.params['error']
fail(OAuthError, error) if error
return fail!(error) if error
@session_state = request.params['session_state']
@id_token = request.params['id_token']
@code = request.params['code']
Expand Down