Skip to content

Commit

Permalink
fix: mcp redirect again
Browse files Browse the repository at this point in the history
  • Loading branch information
jonat75 committed Jul 29, 2024
1 parent 5bf52f1 commit e270085
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions packages/app/src/app/(default)/login/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import Alert from "@codegouvfr/react-dsfr/Alert";
import { config } from "@common/config";
import { type NextServerPageProps } from "@common/utils/next";
import { Box, CenteredContainer, Link } from "@design-system";
import { redirect } from "next/navigation";
import { getServerSession } from "next-auth";

import { EmailLogin } from "./EmailLogin";
Expand Down Expand Up @@ -40,6 +41,8 @@ const LoginPage = async ({ searchParams }: NextServerPageProps<never, "callbackU
const error = typeof searchParams.error === "string" ? searchParams.error : "";
const isEmailLogin = config.api.security.auth.isEmailLogin;

if (session?.user) redirect(callbackUrl);

return (
<CenteredContainer py="6w">
<h1>{title}</h1>
Expand Down

0 comments on commit e270085

Please sign in to comment.