Skip to content

armgit / umami

Public Imported from GitHub
0

Umami is a privacy-first web and product analytics platform. Traffic, campaigns, behavior, conversions, and revenue in one place. No cookies, no surveillance, self-hosted or in the cloud.

Fixed login redirect.

Mike Cao5c933d1c4a5b
diff --git a/rollup.components.config.mjs b/rollup.components.config.mjs
index c4481d0ee..9be073908 100644
--- a/rollup.components.config.mjs
+++ b/rollup.components.config.mjs
@@ -19,6 +19,7 @@ const customResolver = resolve({
const aliasConfig = {
entries: [
+ { find: /^app/, replacement: path.resolve('./src/app') },
{ find: /^components/, replacement: path.resolve('./src/components') },
{ find: /^hooks/, replacement: path.resolve('./src/hooks') },
{ find: /^lib/, replacement: path.resolve('./src/lib') },
diff --git a/src/components/hooks/useRequireLogin.ts b/src/components/hooks/useRequireLogin.ts
index b0d8029d8..76460a557 100644
--- a/src/components/hooks/useRequireLogin.ts
+++ b/src/components/hooks/useRequireLogin.ts
@@ -13,7 +13,7 @@ export function useRequireLogin(handler?: (data?: object) => void) {
setUser(typeof handler === 'function' ? handler(data) : (data as any)?.user);
} catch {
- location.href = `${process.env.basePath}/login`;
+ location.href = `${process.env.basePath || ''}/login`;
}
}