From f603b1ba5eabf804911476bfed2a8e56bb542c22 Mon Sep 17 00:00:00 2001 From: Maximilian Kaske <56969857+mxkaske@users.noreply.github.com> Date: Tue, 22 Aug 2023 10:48:38 +0200 Subject: [PATCH] Fix/custom domain on save (#224) * chore: little stuff * fix: ssr error - checking csr user instead * hotfix: missing custom domain --- apps/web/src/app/app/(auth)/layout.tsx | 9 +++++++-- .../app/(auth)/sign-in/[[...sign-in]]/page.tsx | 10 +--------- .../app/(auth)/sign-up/[[...sign-up]]/page.tsx | 10 +--------- apps/web/src/app/blog/[slug]/page.tsx | 1 - .../src/components/forms/status-page-form.tsx | 1 + apps/web/src/components/layout/app-header.tsx | 2 +- .../src/components/layout/marketing-footer.tsx | 17 ++++++++++------- .../src/components/layout/marketing-header.tsx | 11 ++++++++++- 8 files changed, 31 insertions(+), 30 deletions(-) diff --git a/apps/web/src/app/app/(auth)/layout.tsx b/apps/web/src/app/app/(auth)/layout.tsx index 93509cb0e..38673dcee 100644 --- a/apps/web/src/app/app/(auth)/layout.tsx +++ b/apps/web/src/app/app/(auth)/layout.tsx @@ -1,12 +1,17 @@ import * as React from "react"; - -// TODO: update description +import { redirect } from "next/navigation"; +import { auth } from "@clerk/nextjs"; export default function AuthLayout({ children, }: { children: React.ReactNode; }) { + const { userId } = auth(); + + if (userId) { + redirect("/app"); + } return (