Skip to content
masterclassBuddyTech Buzz5 fresh blogs · 5:00 AM IST

Kinde · Function

isAuthenticated

isAuthenticated checks whether the current Kinde session represents an authenticated user. In a Next.js server component, call it through getKindeServerSession and await the boolean result.

How it works

In the Next.js App Router SDK, obtain the server-session helpers with getKindeServerSession, then call isAuthenticated and await its result. The function reports whether the current session represents an authenticated user; use that boolean to allow protected behavior or prompt for sign-in.

Syntax

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

Returns

A boolean indicating whether the user is authenticated.

Key points

  • The function checks whether the current user is authenticated.
  • Invoke it with parentheses and await the returned authentication state.
  • The server-session helper can be used from any Next.js server component.

Common mistakes

  • The helper must be obtained by destructuring the result of getKindeServerSession before calling it.
  • The check is asynchronous, so await the function result before making an authorization decision.

Example: Check authentication in a Next.js server component

import { getKindeServerSession } from "@kinde-oss/kinde-auth-nextjs/server";

export default async function Page() {
  const { isAuthenticated } = getKindeServerSession();
  const authenticated = await isAuthenticated();
  return <p>{authenticated ? "Signed in" : "Please sign in"}</p>;
}

Reads the server session and awaits the boolean authentication check.

When to use it

Gate a page or component

Protect server-rendered content

Render signed-in or sign-in UI

Choose the appropriate access path

Use the client-side equivalent

Inspect browser authentication state

Interview questions

QHow do you check authentication in a Next.js server component?

Call getKindeServerSession, extract isAuthenticated, and await isAuthenticated(). The resulting boolean indicates whether the user is authenticated.

Follow-up: How would you use it in a client component? Use useKindeBrowserClient and read its isAuthenticated value instead of the server-session helper.

QWhat does isAuthenticated return?

The function returns a boolean: true when the user is authenticated and false otherwise. The documented example stores that result in isUserAuthenticated.

Follow-up: What should unauthenticated requests receive? They should be redirected or shown a sign-in path rather than allowed to access protected behavior.

QWhy must the server-side call be awaited?

The server-side form is asynchronous and must be awaited. This ensures the authentication state is resolved before rendering or protecting the requested content.

Follow-up: Which client-side API exposes the equivalent state? useKindeBrowserClient returns an isAuthenticated value for client components.

  • getKindeServerSession
  • useKindeBrowserClient
  • getUser
  • getPermission

Source: Next.js App Router SDK. Checked 2026-10-15.