mirror of
https://github.com/discourse/discourse.git
synced 2025-02-08 01:37:05 +08: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 DiscourseURL, { userPath } from "discourse/lib/url";
|
||||||
import Category from "discourse/models/category";
|
import Category from "discourse/models/category";
|
||||||
import Composer from "discourse/models/composer";
|
import Composer from "discourse/models/composer";
|
||||||
|
@ -230,7 +231,9 @@ const ApplicationRoute = DiscourseRoute.extend({
|
||||||
|
|
||||||
handleShowLogin() {
|
handleShowLogin() {
|
||||||
if (this.siteSettings.enable_discourse_connect) {
|
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);
|
window.location = getURL("/session/sso?return_path=" + returnPath);
|
||||||
} else {
|
} else {
|
||||||
this.modal.show(LoginModal, {
|
this.modal.show(LoginModal, {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user