MCPcopy Create free account
hub / github.com/code-with-antonio/nodebase / requireAuth

Function requireAuth

src/lib/auth-utils.ts:5–15  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

3import { auth } from "./auth";
4
5export const requireAuth = async () => {
6 const session = await auth.api.getSession({
7 headers: await headers(),
8 });
9
10 if (!session) {
11 redirect("/login");
12 }
13
14 return session;
15};
16
17export const requireUnauth = async () => {
18 const session = await auth.api.getSession({

Callers 7

PageFunction · 0.90
PageFunction · 0.90
PageFunction · 0.90
PageFunction · 0.90
PageFunction · 0.90
PageFunction · 0.90
PageFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected