بنقرة واحدة
authentication-logic
Guide to using Better Auth for client and server-side authentication.
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Guide to using Better Auth for client and server-side authentication.
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
Documentation for the FastAPI backend, endpoints, and dependency injection.
Overview of the project's tech stack, directory structure, and architectural patterns.
Validates and analyzes Docusaurus MDX chapters for structure, pedagogical quality, and component usage.
Details of the RAG Chatbot, including UI and backend logic.
Interaction with NeonDB Postgres using Drizzle ORM.
Knowledge of the Vercel deployment pipeline, hybrid build scripts, and environment configuration.
| name | Authentication Logic |
| description | Guide to using Better Auth for client and server-side authentication. |
We use Better Auth (better-auth) for identifying users.
lib/auth-client.ts exports authClient.lib/auth.ts exports auth.Use authClient for signing in, signing out, and checking session state in Client Components.
import { authClient } from "@/lib/auth-client";
// Sign In
await authClient.signIn.email({
email,
password,
});
// Social Sign In
await authClient.signIn.social({
provider: "google",
callbackURL: "/onboarding",
});
// Sign Out
await authClient.signOut();
Use auth.api.getSession for protecting API routes or Server Actions.
import { auth } from "@/lib/auth";
import { headers } from "next/headers";
const session = await auth.api.getSession({
headers: await headers()
});
if (!session) {
return new Response("Unauthorized", { status: 401 });
}
textbook/src/components/AuthBar/index.tsx./api/auth/session (Next.js API route proxying Better Auth).