Checks if the current request has a valid refresh cookie. Optionally redirects to a URL if the user is not authorized.
Use this in Server Components or layouts to gate access.
Optional
If set, redirects to this URL when the user is not authorized.
true if authorized. If not authorized and redirectUnauthorizedURL is set, triggers a redirect (never returns).
true
redirectUnauthorizedURL
// In a Server Component:import { checkAuthStatus } from "naystack/auth";await checkAuthStatus("/login"); // Redirects to /login if not authenticated Copy
// In a Server Component:import { checkAuthStatus } from "naystack/auth";await checkAuthStatus("/login"); // Redirects to /login if not authenticated
Checks if the current request has a valid refresh cookie. Optionally redirects to a URL if the user is not authorized.
Use this in Server Components or layouts to gate access.