K
Kinde8mo ago
moroshko

isAuthenticated === false vs user === null

Is there any difference (maybe performance?) between:
import { getKindeServerSession } from "@kinde-oss/kinde-auth-nextjs/server";

const { isAuthenticated } = getKindeServerSession();
const isAuthed = await isAuthenticated();

if (!isAuthed) {
...
}
import { getKindeServerSession } from "@kinde-oss/kinde-auth-nextjs/server";

const { isAuthenticated } = getKindeServerSession();
const isAuthed = await isAuthenticated();

if (!isAuthed) {
...
}
and
import { getKindeServerSession } from "@kinde-oss/kinde-auth-nextjs/server";

const { getUser } = getKindeServerSession();
const user = await getUser();

if (!user) {
...
}
import { getKindeServerSession } from "@kinde-oss/kinde-auth-nextjs/server";

const { getUser } = getKindeServerSession();
const user = await getUser();

if (!user) {
...
}
?
1 Reply
Daniel_Kinde
Daniel_Kinde8mo ago
Nothing measurable, more guagued around usage.
isAuthenticated checks if the user exists and returns boolean user returns the user itself
Want results from more Discord servers?
Add your server