diff --git a/next.config.ts b/next.config.ts index d76ff9e..068d1c5 100644 --- a/next.config.ts +++ b/next.config.ts @@ -13,6 +13,9 @@ const nextConfig: NextConfig = { }, ]; }, + async redirects() { + return [{ source: "/", destination: "/en", permanent: true }]; + }, }; const withNextIntl = createNextIntlPlugin(); diff --git a/package-lock.json b/package-lock.json index f360f82..3944405 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "granda-front", - "version": "0.3.15", + "version": "0.3.16", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "granda-front", - "version": "0.3.15", + "version": "0.3.16", "dependencies": { "@radix-ui/react-dropdown-menu": "^2.1.6", "@radix-ui/react-select": "^2.2.6", diff --git a/package.json b/package.json index f69d1f4..0fdcebf 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "granda-front", - "version": "0.3.15", + "version": "0.3.16", "private": true, "scripts": { "dev": "next dev --turbopack", diff --git a/test/e2e/root-redirect.test.ts b/test/e2e/root-redirect.test.ts new file mode 100644 index 0000000..5c1fe9f --- /dev/null +++ b/test/e2e/root-redirect.test.ts @@ -0,0 +1,16 @@ +import { test, testInTournamentAsAdmin } from "./e2eUtils"; + +test("root should redirect not logged-in users to the login page", async ({ + page, +}) => { + await page.goto("/"); + await page.waitForURL(/login/); +}); + +testInTournamentAsAdmin( + "root should redirect logged-in users to tournaments page", + async ({ page }) => { + await page.goto("/"); + await page.waitForURL(/tournaments/); + }, +);