1
0
mirror of https://github.com/chinchang/web-maker.git synced 2025-07-27 00:30:09 +02:00

stop path redirection for logged out users. fixes #557

This commit is contained in:
Kushagra Gour
2024-05-08 10:59:03 +05:30
parent b4d5e51e4b
commit c65883b99c

View File

@@ -108,8 +108,16 @@ if (location.search) {
} }
function customRoute(path) { function customRoute(path) {
// we don't /create redirections on extension since SPA paths don't work there // we don't /create redirections on extension since SPA paths don't work there.
if (window.IS_EXTENSION) return; if (window.IS_EXTENSION) return;
// And also for logged out users, since it will send them to /create/ID and refreshing
// that will try to find that creation in their database, which doesn't exist. LOgged out
// users anyways can't do anything with the urls.
// Exception is /create. this is needed because a logged out user can visit a /create/ID
// of some other user and then create a new item...at which point they shud come back
// to /create
if (!window.user && path !== '/create') return;
else { else {
route(path); route(path);
} }