Skip to content

Commit

Permalink
Fixed login redirect.
Browse files Browse the repository at this point in the history
  • Loading branch information
mikecao committed Oct 4, 2023
1 parent 367e0ec commit 5c933d1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions rollup.components.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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') },
Expand Down
2 changes: 1 addition & 1 deletion src/components/hooks/useRequireLogin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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`;
}
}

Expand Down

0 comments on commit 5c933d1

Please sign in to comment.