auth
为 Next.js 实现 Supabase 身份验证
Next.js 和 Supabase 中的身份验证流程可能会在页面、操作和租户之间变得不一致。此技能提供用于路由保护、角色、OAuth 和基于家庭的数据隔离的服务器端模式。
安装前请停下并请求确认。
请审查安装计划,并在更改文件前获得用户明确同意。
使用我的智能体安装
将此请求复制给你的智能体,其中包含权威 Skill 页面和清单。
Review the Skillstore skill "auth" from https://skillstore.io/skills/bom-98-auth.md and its manifest at https://skillstore.io/api/skills/bom-98-auth/manifest. Verify the artifact. Stop and obtain explicit user consent before installing or changing files.你的智能体仍应展示其计划,并按安全策略请求必要确认。
Agent 可读资源
当 AI Agent、爬虫或脚本需要干净上下文,而不是读取完整页面时,请使用这些链接。
测试它
正在使用“auth”。 保护仪表板页面,防止未经身份验证的访问者访问。
预期结果:
- 识别要在页面或布局中使用的服务器端辅助函数。
- 在返回受保护内容之前执行检查。
- 说明未通过身份验证用户的预期重定向行为。
正在使用“auth”。 审查家庭数据更新流程。
预期结果:
- 确认操作首先验证当前用户。
- 检查提交的家庭标识符是否与用户个人资料匹配。
- 指出数据变更发生前缺失的租户检查。
正在使用“auth”。 规划 GitHub OAuth 支持。
预期结果:
- 列出 Supabase 中的提供方设置要求。
- 描述登录操作和回调路由的职责。
- 说明重定向应将已通过身份验证的用户发送到何处。
安全审计
高风险All 62 static findings are false positives caused by Markdown formatting, documentation examples, placeholder URLs, and auth schema descriptions. No command execution, reconnaissance, environment-file reading, or live network request exists in the reviewed skill files. One high-severity semantic issue remains: the registration design stores SSNs and other sensitive personal data in Supabase user metadata.
已确认安全问题 (1)
风险因素
⚙️ 外部命令 (47)
分享与引用此报告
分享版本化评估报告、中性徽章、嵌入卡片和引用。Skillstore 只报告证据,不判断该 Skill 是否安全。
复制报告链接
https://skillstore.io/skills/bom-98-auth/audits/9?utm_source=security_passport&utm_medium=share&utm_campaign=versioned_reportMarkdown 徽章
[](https://skillstore.io/skills/bom-98-auth?utm_source=security_passport_badge)HTML 徽章
<a href="https://skillstore.io/skills/bom-98-auth?utm_source=security_passport_badge"><img src="https://skillstore.io/badges/skills/bom-98-auth/security.svg" alt="Skillstore security assessment" loading="lazy"></a>嵌入卡片
<iframe src="https://skillstore.io/embed/skills/bom-98-auth.html" title="Skillstore Security Assessment" sandbox="allow-popups allow-popups-to-escape-sandbox" loading="lazy" referrerpolicy="no-referrer" width="420" height="180"></iframe>学术引用 (APA · BibTeX · CFF)
APA 引用
BOM-98. (2026). auth security audit report (audit version 9) [Author version unspecified]. Skillstore. https://skillstore.io/skills/bom-98-auth/audits/9BibTeX 引用
@techreport{bom-98-bom-98-auth-2026,
author = {BOM-98},
title = {auth security audit report (audit version 9)},
institution = {Skillstore},
year = {2026},
number = {9},
url = {https://skillstore.io/skills/bom-98-auth/audits/9},
note = {Author version unspecified}
}CITATION.cff
cff-version: 1.2.0
message: "If you use this Skill, cite its author and this versioned security audit report."
title: "auth security audit report (audit version 9)"
version: "unspecified"
type: report
authors:
- name: "BOM-98"
date-released: "2026-07-23"
url: "https://skillstore.io/skills/bom-98-auth/audits/9"
identifiers:
- type: other
value: "skillstore:bom-98-auth:audit:9"
description: "Skillstore immutable audit report identifier"
比较变体
3 个可安装变体每位作者的技能都保持为独立的可安装项。推荐变体按 Skillstore 证据排序。
为什么此变体排名第一
Skillstore 评分
评分依据 证据置信度: 中你能构建什么
保护应用程序路由
为受保护的页面、布局和 Server Actions 添加一致的身份验证检查。
审查授权边界
检查管理员功能和家庭范围的数据访问是否使用服务器端强制执行。
规划 Supabase Auth 迁移
在实现之前映射登录、注册、OAuth、电子邮件验证和令牌刷新流程。
试试这些提示
使用此身份验证技能,在使用 Supabase Auth 的 Next.js 15 App Router 项目中保护新的仪表板页面。
使用此身份验证技能,为更新用户个人资料数据的 Server Action 添加服务器端身份验证。
使用此身份验证技能,为设置区域设计仅限管理员页面和 Server Action 检查。
使用此身份验证技能,审查家庭范围的数据操作是否强制执行服务器端租户隔离。
最佳实践
- 在受保护工作之前,使用 Supabase 令牌重新验证在服务器上验证用户。
- 在 Server Actions 中强制执行角色和租户访问,而不仅仅是在界面中执行。
- 保持身份验证辅助函数仅限服务器端使用,并避免向 Client Components 暴露敏感逻辑。
避免
- 依赖客户端角色检查来做出授权决策。
- 在服务器上使用会话数据而不进行令牌重新验证。
- 处理用户提供的家庭标识符时跳过家庭访问检查。
常见问题
此技能是为哪个框架设计的?
它是否包含完整的应用程序代码?
它能帮助处理 Server Actions 吗?
它是否支持基于角色的访问控制?
它如何处理多租户数据?
Claude、Codex 或 Claude Code 可以使用此技能吗?
开发者详情
作者
BOM-98许可证
MIT
Skillstore 修订
r2
版本提示
作者未声明版本。
引用
a39a91716eadede5f4cdefd78178fed4e837a128
维护新鲜度
2026/7/26
使用量
4 次下载 · 384 次浏览
文件结构