Skip to content

Commit

Permalink
feat: display connected email, redirect otherwise
Browse files Browse the repository at this point in the history
  • Loading branch information
cedricss committed Nov 8, 2024
1 parent 2b7bf90 commit cbcf600
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion app/espace-laureat/page.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,18 @@
export default function EspaceLaureat() {
import { redirect } from "next/navigation";

import { getSession } from "@/utils/session";

export default async function EspaceLaureat() {
const session = await getSession();

if (!session?.user?.email) {
return redirect("/connexion");
}

return (
<div className="max-w-2xl pb-24">
<h1>Espace lauréat</h1>
<p>{session.user.email}</p>
<p className="fr-text--lead">
Suivez vos subventions et réalisez une demande de versement.
</p>
Expand Down

0 comments on commit cbcf600

Please sign in to comment.