mirror of
https://github.com/docmost/docmost.git
synced 2026-05-07 22:53:08 +08:00
d42091ccb1
* feat: favorites and templates(ee) * rename migrations * fix sidebar * cleanup tabs * fix * turn off templates * cleanup * uuid validation
51 lines
1.3 KiB
TypeScript
51 lines
1.3 KiB
TypeScript
const APP_ROUTE = {
|
|
HOME: "/home",
|
|
SPACES: "/spaces",
|
|
FAVORITES: "/favorites",
|
|
SEARCH: "/search",
|
|
AUTH: {
|
|
LOGIN: "/login",
|
|
SIGNUP: "/signup",
|
|
SETUP: "/setup/register",
|
|
FORGOT_PASSWORD: "/forgot-password",
|
|
PASSWORD_RESET: "/password-reset",
|
|
CREATE_WORKSPACE: "/create",
|
|
SELECT_WORKSPACE: "/select",
|
|
MFA_CHALLENGE: "/login/mfa",
|
|
MFA_SETUP_REQUIRED: "/login/mfa/setup",
|
|
VERIFY_EMAIL: "/verify-email",
|
|
},
|
|
SETTINGS: {
|
|
ACCOUNT: {
|
|
PROFILE: "/settings/account/profile",
|
|
PREFERENCES: "/settings/account/preferences",
|
|
},
|
|
WORKSPACE: {
|
|
GENERAL: "/settings/workspace",
|
|
MEMBERS: "/settings/members",
|
|
GROUPS: "/settings/groups",
|
|
SPACES: "/settings/spaces",
|
|
BILLING: "/settings/billing",
|
|
SECURITY: "/settings/security",
|
|
},
|
|
},
|
|
};
|
|
|
|
export function getPostLoginRedirect(): string {
|
|
const params = new URLSearchParams(window.location.search);
|
|
const redirect = params.get("redirect");
|
|
if (redirect) {
|
|
try {
|
|
const resolved = new URL(redirect, window.location.origin);
|
|
if (resolved.origin === window.location.origin) {
|
|
return resolved.pathname + resolved.search + resolved.hash;
|
|
}
|
|
} catch {
|
|
// malformed URL, fall through to default
|
|
}
|
|
}
|
|
return APP_ROUTE.HOME;
|
|
}
|
|
|
|
export default APP_ROUTE;
|