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

rails 6 redirect_to use allow_other_host: true #263

Merged
merged 2 commits into from
Jul 17, 2019
Merged
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
4 changes: 2 additions & 2 deletions lib/wechat/controller_api.rb
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def wechat_public_oauth2(oauth2_params, account = nil)
cookies.signed_or_encrypted[:we_access_token] = { value: access_info['access_token'], expires: self.class.oauth2_cookie_duration.from_now }
yield access_info['openid'], access_info
else
redirect_to generate_oauth2_url(oauth2_params)
(Rails::VERSION::MAJOR >= 6) ? (redirect_to generate_oauth2_url(oauth2_params), allow_other_host: true) : (redirect_to generate_oauth2_url(oauth2_params))
end
end

Expand All @@ -70,7 +70,7 @@ def wechat_corp_oauth2(oauth2_params, account = nil)
cookies.signed_or_encrypted[:we_deviceid] = { value: userinfo['DeviceId'], expires: self.class.oauth2_cookie_duration.from_now }
yield userinfo['UserId'], userinfo
else
redirect_to generate_oauth2_url(oauth2_params)
(Rails::VERSION::MAJOR >= 6) ? (redirect_to generate_oauth2_url(oauth2_params), allow_other_host: true) : (redirect_to generate_oauth2_url(oauth2_params))
end
end

Expand Down