Skip to content

Commit b6af9a5

Browse files
committed
refactor(ui): update home page and auth hook for refactor
1 parent db6dfa6 commit b6af9a5

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

apps/desktop-ui/app/(app)/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ function HomeContent() {
3535

3636
useEffect(() => {
3737
if (!isLoading && !isAuthenticated) {
38-
router.push('/login')
38+
router.push('/login/')
3939
}
4040
}, [isLoading, isAuthenticated, router])
4141

apps/desktop-ui/hooks/use-auth.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ export function AuthProvider({ children }: { children: ReactNode }) {
108108
setUser(userData);
109109
await refreshActiveRepository();
110110
toast.success('Authenticated. Opening OpenLinear...');
111-
if (pathname === '/login') {
111+
if (pathname === '/login' || pathname === '/login/') {
112112
router.replace('/');
113113
}
114114
} catch (err) {
@@ -193,8 +193,8 @@ export function AuthProvider({ children }: { children: ReactNode }) {
193193
setUser(null);
194194
setActiveRepository(null);
195195
toast.error('Session expired. Please sign in again.');
196-
if (pathname !== '/login' && pathname !== '/') {
197-
router.push('/login');
196+
if (pathname !== '/login' && pathname !== '/login/' && pathname !== '/') {
197+
router.push('/login/');
198198
}
199199
};
200200

0 commit comments

Comments
 (0)