Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/dashboard/src/components/layout/account-menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ export function AccountMenu({ user }: { user: AuthSessionUser }) {
onClick={async () => {
setOpen(false);
await api.logout();
location.href = '/login';
location.href = '/';
}}
>
<LogOut
Expand Down
8 changes: 4 additions & 4 deletions apps/dashboard/src/lib/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ async function request<T>(input: string, init?: RequestInit) {
});

if (response.status === 401) {
if (location.pathname !== '/login') {
location.href = '/login';
if (location.pathname !== '/') {
location.href = '/';
}
throw new Error('Unauthorized');
}
Expand Down Expand Up @@ -92,8 +92,8 @@ async function requestWithMeta<T>(input: string, init?: RequestInit) {
});

if (response.status === 401) {
if (location.pathname !== '/login') {
location.href = '/login';
if (location.pathname !== '/') {
location.href = '/';
}
throw new Error('Unauthorized');
}
Expand Down
102 changes: 0 additions & 102 deletions apps/dashboard/src/pages/login.tsx

This file was deleted.

6 changes: 0 additions & 6 deletions apps/dashboard/src/routes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import type { NavItem } from '@client/nav';

const LandingPage = React.lazy(() => import('./pages/landing').then(m => ({ default: m.LandingPage })));
const DashboardPage = React.lazy(() => import('./pages/dashboard').then(m => ({ default: m.DashboardPage })));
const LoginPage = React.lazy(() => import('./pages/login').then(m => ({ default: m.LoginPage })));
const JobsPage = React.lazy(() => import('./pages/jobs').then(m => ({ default: m.JobsPage })));
const JobDetailPage = React.lazy(() => import('./pages/job-detail').then(m => ({ default: m.JobDetailPage })));
const JobLogsPage = React.lazy(() => import('./pages/job-logs').then(m => ({ default: m.JobLogsPage })));
Expand All @@ -31,11 +30,6 @@ export const publicRoutes: RouteObject[] = [
element: withSuspense(LandingPage, true),
errorElement: <RouteErrorBoundary />,
},
{
path: '/login',
element: withSuspense(LoginPage, true),
errorElement: <RouteErrorBoundary />,
},
];

// A boundary per child too, not just on the layout: React Router replaces the whole matched branch, so a branch-only boundary would take the sidebar and header down with a single page.
Expand Down
1 change: 0 additions & 1 deletion apps/worker/wrangler.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@
"not_found_handling": "single-page-application",
"run_worker_first": [
"/",
"/login",
"/dashboard*",
"/jobs*",
"/repos*",
Expand Down
6 changes: 3 additions & 3 deletions test/e2e/dashboard.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*/
import { expect, it, describe, vi, beforeEach } from 'vitest';
import { render, screen } from '@testing-library/react';
import { LoginPage } from '@client/pages/login';
import { LandingPage } from '@client/pages/landing';
import { DashboardPage } from '@client/pages/dashboard';
import { MemoryRouter } from 'react-router-dom';
import { api } from '@client/lib/api';
Expand Down Expand Up @@ -34,12 +34,12 @@ describe('Frontend UI Flows (JSDOM)', () => {
render(
<ThemeProvider>
<MemoryRouter>
<LoginPage />
<LandingPage />
</MemoryRouter>
</ThemeProvider>
);

const signInLink = screen.getByRole('link', { name: 'Sign in with GitHub' });
const signInLink = screen.getByRole('link', { name: /continue with github/i });
expect(signInLink.getAttribute('href')).toBe('/auth/github');
});

Expand Down
2 changes: 1 addition & 1 deletion test/e2e/router-extensions.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ describe('Dashboard route and nav registries (JSDOM)', () => {
});

it('exposes the built-in routes as composable arrays', () => {
expect(publicRoutes.map((r) => r.path)).toEqual(['/', '/login']);
expect(publicRoutes.map((r) => r.path)).toEqual(['/']);
expect(shellRoutes.map((r) => r.path)).toContain('dashboard');
expect([...publicRoutes, ...shellRoutes].map((r) => r.path)).not.toContain('*');
});
Expand Down
Loading