mirror of
https://github.com/discourse/discourse.git
synced 2024-11-27 11:20:57 -06:00
FIX: support /my routes with subfolders
This commit is contained in:
parent
aee316c6ff
commit
e7d8f5f9c8
@ -193,10 +193,10 @@ const DiscourseURL = Ember.Object.extend({
|
|||||||
path = path.replace(/(https?\:)?\/\/[^\/]+/, '');
|
path = path.replace(/(https?\:)?\/\/[^\/]+/, '');
|
||||||
|
|
||||||
// Rewrite /my/* urls
|
// Rewrite /my/* urls
|
||||||
if (path.indexOf('/my/') === 0) {
|
if (path.indexOf(Discourse.BaseUri + '/my/') === 0) {
|
||||||
const currentUser = Discourse.User.current();
|
const currentUser = Discourse.User.current();
|
||||||
if (currentUser) {
|
if (currentUser) {
|
||||||
path = path.replace('/my/', userPath(currentUser.get('username_lower') + "/"));
|
path = path.replace(Discourse.BaseUri + '/my/', userPath(currentUser.get('username_lower') + "/"));
|
||||||
} else {
|
} else {
|
||||||
document.location.href = "/404";
|
document.location.href = "/404";
|
||||||
return;
|
return;
|
||||||
|
Loading…
Reference in New Issue
Block a user