79178770

Date: 2024-11-11 18:33:26
Score: 1.5
Natty:
Report link

I found a very easy solution to handle this. Docs: https://clerk.com/docs/references/nextjs/auth

import React from "react";
import { auth } from "@clerk/nextjs/server";
import { getDictionary } from "@/locales/dictionary";
import TenantTable from "@/components/TenantTable/TenantTable";

export default async function Page() {

  const dict = await getDictionary();
  const { userId, redirectToSignIn } = await auth();
  if (!userId) return redirectToSignIn();
  return (
    <div>
     Hello, ${userID}
    </div>
  );
}
Reasons:
  • Probably link only (1):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: Shristi Gupta