chore: add .env.exmaple on examples

This commit is contained in:
Bereket Engida
2024-10-14 20:06:03 +03:00
parent 256c8ca5ed
commit 2bc21748e7
75 changed files with 796 additions and 1225 deletions

View File

@@ -5,7 +5,7 @@ import { headers } from "next/headers";
export async function SignInButton() {
const session = await auth.api.getSession({
headers: headers(),
headers: await headers(),
});
return (
@@ -49,9 +49,9 @@ function checkOptimisticSession(headers: Headers) {
return !!guessIsSignIn;
}
export function SignInFallback() {
export async function SignInFallback() {
//to avoid flash of unauthenticated state
const guessIsSignIn = checkOptimisticSession(headers());
const guessIsSignIn = checkOptimisticSession(await headers());
return (
<Link
href={guessIsSignIn ? "/dashboard" : "/sign-in"}