Skip to content

Commit 446482d

Browse files
committed
Don't allow bypassing auth with non-json/html format
1 parent c68d9ea commit 446482d

File tree

1 file changed

+2
-0
lines changed
  • lib/two_factor_authentication/controllers

1 file changed

+2
-0
lines changed

lib/two_factor_authentication/controllers/helpers.rb

+2
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@ def handle_failed_second_factor(scope)
2727
elsif request.format.json?
2828
session["#{scope}_return_to"] = root_path(format: :html)
2929
render json: { redirect_to: two_factor_authentication_path_for(scope) }, status: :unauthorized
30+
else
31+
head :unauthorized
3032
end
3133
else
3234
head :unauthorized

0 commit comments

Comments
 (0)