JA
ベータ版の翻訳

@yohangel / auth-nest

1.0.0 ▾
MIT
GitHub

NestJS 用 Better Auth:@AllowAnonymous、@OptionalAuth、@Session 付きグローバルガード

コード3 ファイルコンテキスト約 369 トークンスキャン合格

.genpmignore 適用後に組み込まれる正確なツリーです。固定先:

src/lib/auth-nest/index.ts読み取り専用 · 7145b9d
// @yohangel/auth-nest — Better Auth en NestJS (plataforma Express) vía @thallesp/nestjs-better-auth.
// Registra un AuthGuard GLOBAL: toda ruta exige sesión salvo @AllowAnonymous() u @OptionalAuth().
// main.ts: `NestFactory.create(AppModule, { bodyParser: false })` (Better Auth lee el cuerpo; el módulo vuelve a
// activar json/urlencoded para el resto de rutas).
import { AuthModule } from '@thallesp/nestjs-better-auth';
import { type CreateAuthOptions, createAuth } from '../auth/index.js';

/** `imports: [authModule()]` en tu AppModule. */
export function authModule(opts: CreateAuthOptions = {}) {
  return AuthModule.forRoot({ auth: createAuth(opts) });
}

export {
  AllowAnonymous,
  AuthGuard,
  OptionalAuth,
  Session,
  type UserSession,
} from '@thallesp/nestjs-better-auth';

@yohangel/auth-nest を報告

パッケージを報告するには GitHub でログインしてください。

GitHub で続ける