fastify-better-auth-bridge by acedergren/agentic-tools
npx skills add https://github.com/acedergren/agentic-tools --skill fastify-better-auth-bridge当 Better Auth 已存在但 Fastify 仍需框架桥接时,请使用此技能。
auth.api.getSession() 是正确的数据源onRequest 会话查找、Cookie 转发或 decorateRequest() 行为属于处理范围org_members 配置规则RequestBetter Auth 会话查找需要携带 Cookie 的请求头。从以下内容构建 Request:
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
标准化以下内容:
request.userrequest.sessionrequest.permissionsrequest.apiKeyContext对于 Fastify 5 的数组状态,请使用基于 Symbol 的 getter/setter,而不是共享的可变默认值。
仅跳过那些真正应该绕过会话处理的路径,例如:
在匹配之前,请标准化查询字符串和尾部斜杠。
桥接应解析身份上下文。路由守卫应决定访问权限。
如果会话查找抛出异常:
org_members 修补缺失的组织上下文IDCS 配置的用户可能从未调用过 Better Auth 的显式组织切换流程。如果缺少 activeOrganizationId,请从 org_members 解析成员资格并修补下游会话状态。
onRequest 钩子中强制执行 RBAC 策略。node scripts/check-fastify-auth-bridge.js /path/to/auth-plugin.ts
如果不带参数,脚本将扫描当前代码库中的 apps/api/src/plugins/auth.ts。
如果认证模块不在默认路径下,请将检查器指向实际的插件文件。即使文件布局不同,也请保持相同的桥接结构。
reply.send(undefined) 在 Fastify 5 中会抛出异常。Request 桥接辅助函数。onRequest 中解析会话。node scripts/check-fastify-auth-bridge.js。$ARGUMENTS:要检查或对齐的 Fastify 认证插件文件的可选路径
/fastify-better-auth-bridge apps/api/src/plugins/auth.ts每周安装量
1
代码库
GitHub 星标数
6
首次出现
1 天前
安全审计
安装于
amp1
cline1
opencode1
cursor1
kimi-cli1
codex1
Use this skill when Better Auth exists already but Fastify still needs the framework bridge.
auth.api.getSession() is the right source of truthonRequest session lookup, cookie forwarding, or decorateRequest() behavior is in scopeorg_members provisioning rulesRequestBetter Auth session lookup needs cookie-bearing headers. Build a Request from:
Standardize:
request.userrequest.sessionrequest.permissionsrequest.apiKeyContextFor Fastify 5 array state, use a Symbol-backed getter/setter instead of shared mutable defaults.
Skip only routes that should truly bypass session work, such as:
Normalize query strings and trailing slashes before matching.
The bridge should resolve identity context. Route guards should decide access.
If session lookup throws:
org_membersIDCS-provisioned users may never have called Better Auth's explicit organization-switch flow. If activeOrganizationId is missing, resolve membership from org_members and patch downstream session state.
onRequest hook.node scripts/check-fastify-auth-bridge.js /path/to/auth-plugin.ts
With no argument, the script scans apps/api/src/plugins/auth.ts in the current repo.
If auth lives outside the default path, point the checker at the real plugin file. Keep the same bridge shape even if the file layout differs.
reply.send(undefined) throws in Fastify 5.Request bridge helper.onRequest.node scripts/check-fastify-auth-bridge.js.$ARGUMENTS: Optional path to the Fastify auth plugin file to inspect or align
/fastify-better-auth-bridge apps/api/src/plugins/auth.tsWeekly Installs
1
Repository
GitHub Stars
6
First Seen
1 day ago
Security Audits
Gen Agent Trust HubPassSocketFailSnykPass
Installed on
amp1
cline1
opencode1
cursor1
kimi-cli1
codex1
Better Auth 最佳实践指南:集成、配置与安全设置完整教程
30,700 周安装