mirror of
https://github.com/LukeHagar/better-auth.git
synced 2025-12-09 04:19:26 +00:00
chore: add .env.exmaple on examples
This commit is contained in:
@@ -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"}
|
||||
|
||||
Reference in New Issue
Block a user