mirror of
https://github.com/discourse/discourse.git
synced 2025-05-29 00:00:46 +08:00
FIX: don't redirect incorrectly after full screen login (#7170)
Fixes two issues: 1. Redirecting to an external origin's path after login did not work 2. User would be erroneously redirected to the external origin after logout https://meta.discourse.org/t/109755
This commit is contained in:

committed by
David Taylor

parent
6fb49e74a1
commit
b084750953
@ -57,17 +57,18 @@ class Users::OmniauthCallbacksController < ApplicationController
|
||||
rescue URI::Error
|
||||
end
|
||||
|
||||
if parsed
|
||||
@origin = "#{parsed.path}?#{parsed.query}"
|
||||
if parsed && (parsed.host == nil || parsed.host == Discourse.current_hostname)
|
||||
@origin = "#{parsed.path}"
|
||||
@origin << "?#{parsed.query}" if parsed.query
|
||||
end
|
||||
end
|
||||
|
||||
if @origin.blank?
|
||||
@origin = Discourse.base_uri("/")
|
||||
else
|
||||
@auth_result.destination_url = origin
|
||||
end
|
||||
|
||||
@auth_result.destination_url = origin
|
||||
|
||||
if @auth_result.failed?
|
||||
flash[:error] = @auth_result.failed_reason.html_safe
|
||||
return render('failure')
|
||||
|
Reference in New Issue
Block a user