一键导入
auth-setup
Setting up authentication with guards, sessions, registration, password reset, gates/policies, and vendor views in Rudder
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Setting up authentication with guards, sessions, registration, password reset, gates/policies, and vendor views in Rudder
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | auth-setup |
| description | Setting up authentication with guards, sessions, registration, password reset, gates/policies, and vendor views in Rudder |
| license | MIT |
| appliesTo | ["@rudderjs/auth"] |
| trigger | configuring guards/providers in `config/auth.ts`, vendoring auth views, wiring `Gate`/`Policy`, or working with password reset / email verification |
| skip | a route handler that just reads `Auth.user()` — no setup needed |
| metadata | {"author":"rudderjs"} |
Load when you're configuring guards/providers, vendoring auth views, wiring Gate/Policy authorization, or working with password reset / email verification. For depth, open the rule file matching your task.
| Task | Open |
|---|---|
Provider setup — install deps, config/auth.ts, register provider, make User authenticatable | rules/provider-setup.md |
Reading the current user — auth(), Auth facade, RequireAuth / RequireGuest middleware, login/logout endpoints | rules/guards-and-handlers.md |
Login / register UI — vendor:publish auth views, registerAuthRoutes, custom paths and view ids | rules/auth-views.md |
Authorization — Gate.define, model Policy classes, before callbacks | rules/gates-and-policies.md |
Email verification + password reset — MustVerifyEmail, verificationUrl, PasswordBroker | rules/email-and-password-reset.md |
SessionGuard instances per call. Never cached — cached guards leak _user across requests.auth() helper — Laravel-style accessor returning the request-scoped AuthManager via AsyncLocalStorage.Auth facade — Auth.user(), Auth.check(), etc. — static class that proxies to currentAuth().AuthMiddleware auto-installs on the web group only. API routes are stateless by default; use RequireBearer() + scope(...) (passport) for token auth per-route.SessionGuard.user() soft-fails — returns null (not throw) when there's no ALS context, matching Laravel's Auth::user() semantics.@rudderjs/session and @rudderjs/hash are required peers. HashProvider must boot before AuthProvider (defaultProviders() orders this automatically).See playground/config/auth.ts, playground/app/Models/User.ts, playground/routes/web.ts, and playground/app/Views/Auth/.
Building MCP servers with tools, resources, prompts, decorators, and HTTP/stdio transports in Rudder
Creating Eloquent-style models, queries, relationships, casts, factories, and API resources in Rudder
Creating controller-returned views with route overrides, multi-framework support, and the html tagged template in Rudder
Building AI agents with tools, streaming, conversation memory, approval flows, and middleware in Rudder
Defining server and client tools with Zod schemas, approval gates, streaming yields, and modelOutput for Rudder AI agents
Setting up authentication with guards, sessions, registration, password reset, gates/policies, and vendor views in Rudder