mirror of
https://github.com/discourse/discourse.git
synced 2024-11-25 18:30:26 -06:00
FIX: use the destination_url
cookie as return_path
if present (#23594)
This commit is contained in:
parent
8823b5e504
commit
aa9510a731
@ -1,3 +1,4 @@
|
||||
import cookie from "discourse/lib/cookie";
|
||||
import DiscourseURL, { userPath } from "discourse/lib/url";
|
||||
import Category from "discourse/models/category";
|
||||
import Composer from "discourse/models/composer";
|
||||
@ -230,7 +231,9 @@ const ApplicationRoute = DiscourseRoute.extend({
|
||||
|
||||
handleShowLogin() {
|
||||
if (this.siteSettings.enable_discourse_connect) {
|
||||
const returnPath = encodeURIComponent(window.location.pathname);
|
||||
const returnPath = cookie("destination_url")
|
||||
? getURL("/")
|
||||
: encodeURIComponent(window.location.pathname);
|
||||
window.location = getURL("/session/sso?return_path=" + returnPath);
|
||||
} else {
|
||||
this.modal.show(LoginModal, {
|
||||
|
Loading…
Reference in New Issue
Block a user