Skip to content

Commit b55d9dc

Browse files
Merge pull request #171 from datacite/fix-unsafe-redirect-error-part-2
fix unsafe redirect error part 2
2 parents 1bf6ee3 + 7f2b623 commit b55d9dc

File tree

2 files changed

+14
-7
lines changed

2 files changed

+14
-7
lines changed

app/controllers/users/sessions_controller.rb

-7
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,5 @@ def empty_cookie
5454
secure: !Rails.env.development? && !Rails.env.test?,
5555
domain: domain }
5656
end
57-
58-
private
59-
def redirect_options
60-
{
61-
allow_other_host: true
62-
}
63-
end
6457
end
6558
end
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# frozen_string_literal: true
2+
3+
module Devise
4+
module Controllers
5+
module Helpers
6+
def redirect_to(options = {}, response_options = {})
7+
if options.is_a?(String) && options.match?(/\Ahttps?:\/\//)
8+
response_options[:allow_other_host] = true
9+
end
10+
super(options, response_options)
11+
end
12+
end
13+
end
14+
end

0 commit comments

Comments
 (0)