mirror of
https://github.com/LukeHagar/better-auth.git
synced 2025-12-10 04:19:32 +00:00
chore: fix demo dep issue
This commit is contained in:
@@ -11,19 +11,16 @@ import {
|
|||||||
} from "@/components/ui/card";
|
} from "@/components/ui/card";
|
||||||
import { CheckIcon, XIcon } from "lucide-react";
|
import { CheckIcon, XIcon } from "lucide-react";
|
||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { useRouter } from "next/navigation";
|
import { useParams, useRouter } from "next/navigation";
|
||||||
import { Skeleton } from "@/components/ui/skeleton";
|
import { Skeleton } from "@/components/ui/skeleton";
|
||||||
import { client, organization } from "@/lib/auth-client";
|
import { client, organization } from "@/lib/auth-client";
|
||||||
import { InvitationError } from "./invitation-error";
|
import { InvitationError } from "./invitation-error";
|
||||||
import { Invitation } from "@/lib/auth-types";
|
import { Invitation } from "@/lib/auth-types";
|
||||||
|
|
||||||
export default function InvitationPage({
|
export default function InvitationPage() {
|
||||||
params,
|
const params = useParams<{
|
||||||
}: {
|
|
||||||
params: {
|
|
||||||
id: string;
|
id: string;
|
||||||
};
|
}>();
|
||||||
}) {
|
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const [invitationStatus, setInvitationStatus] = useState<
|
const [invitationStatus, setInvitationStatus] = useState<
|
||||||
"pending" | "accepted" | "rejected"
|
"pending" | "accepted" | "rejected"
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
import { SignInButton, SignInFallback } from "@/components/sign-in-btn";
|
import { SignInButton, SignInFallback } from "@/components/sign-in-btn";
|
||||||
import { headers } from "next/headers";
|
|
||||||
import { Suspense } from "react";
|
import { Suspense } from "react";
|
||||||
|
|
||||||
export default async function Home() {
|
export default async function Home() {
|
||||||
|
|||||||
@@ -49,9 +49,9 @@ function checkOptimisticSession(headers: Headers) {
|
|||||||
return !!guessIsSignIn;
|
return !!guessIsSignIn;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function SignInFallback() {
|
export async function SignInFallback() {
|
||||||
//to avoid flash of unauthenticated state
|
//to avoid flash of unauthenticated state
|
||||||
const guessIsSignIn = checkOptimisticSession(headers());
|
const guessIsSignIn = checkOptimisticSession(await headers());
|
||||||
return (
|
return (
|
||||||
<Link
|
<Link
|
||||||
href={guessIsSignIn ? "/dashboard" : "/sign-in"}
|
href={guessIsSignIn ? "/dashboard" : "/sign-in"}
|
||||||
|
|||||||
Reference in New Issue
Block a user