首页/安全与合规/convex-setup-auth
C

convex-setup-auth

by @get-convexv1.0.0
0.0(0)

在Convex中实现安全的用户认证,支持多种身份验证方式,确保用户数据和系统访问的安全性。

Convex SecurityAuthentication SetupUser ManagementAccess ControlGitHub
安装方式
npx skills add get-convex/agent-skills --skill convex-setup-auth
compare_arrows

Before / After 效果对比

1
使用前

Convex应用认证机制薄弱,存在安全隐患,用户数据不安全。

使用后

实现安全认证,保护用户数据,提升应用整体安全性。

description SKILL.md

convex-setup-auth

Convex Authentication Setup Implement secure authentication in Convex with user management and access control. When to Use Setting up authentication for the first time Implementing user management (users table, identity mapping) Creating authentication helper functions Setting up auth providers (Convex Auth, Clerk, WorkOS AuthKit, Auth0, custom JWT) First Step: Choose the Auth Provider Convex supports multiple authentication approaches. Do not assume a provider. Before writing setup code: Ask the user which auth solution they want, unless the repository already makes it obvious If the repo already uses a provider, continue with that provider unless the user wants to switch If the user has not chosen a provider and the repo does not make it obvious, ask before proceeding Common options: Convex Auth - good default when the user wants auth handled directly in Convex Clerk - use when the app already uses Clerk or the user wants Clerk's hosted auth features WorkOS AuthKit - use when the app already uses WorkOS or the user wants AuthKit specifically Auth0 - use when the app already uses Auth0 Custom JWT provider - use when integrating an existing auth system not covered above Look for signals in the repo before asking: Dependencies such as @clerk/, @workos-inc/, @auth0/*, or Convex Auth packages Existing files such as convex/auth.config.ts, auth middleware, provider wrappers, or login components Environment variables that clearly point at a provider After Choosing a Provider Read the provider's official guide and the matching local reference file: Convex Auth: official docs, then references/convex-auth.md Clerk: official docs, then references/clerk.md WorkOS AuthKit: official docs, then references/workos-authkit.md Auth0: official docs, then references/auth0.md The local reference files contain the concrete workflow, expected files and env vars, gotchas, and validation checks. Use those sources for: package installation client provider wiring environment variables convex/auth.config.ts setup login and logout UI patterns framework-specific setup for React, Vite, or Next.js For shared auth behavior, use the official Convex docs as the source of truth: Auth in Functions for ctx.auth.getUserIdentity() Storing Users in the Convex Database for optional app-level user storage Authentication for general auth and authorization guidance Convex Auth Authorization when the provider is Convex Auth Do not invent a provider-agnostic user sync pattern from memory. For third-party providers, only add app-level user storage if the app actually needs user documents in Convex. For Convex Auth, do not add a parallel users table plus storeUser flow. Follow the Convex Auth docs and built-in auth tables instead. Do not invent provider-specific setup from memory when the docs are available. Do not assume provider initialization commands finish the entire integration. Verify generated files and complete the post-init wiring steps the provider reference calls out. Workflow Determine the provider, either by asking the user or inferring from the repo Ask whether the user wants local-only setup or production-ready setup now Read the matching provider reference file Follow the official provider docs for current setup details Follow the official Convex docs for shared backend auth behavior, user storage, and authorization patterns Only add app-level user storage if the docs and app requirements call for it Add authorization checks for ownership, roles, or team access only where the app needs them Verify login state, protected queries, environment variables, and production configuration if requested If the flow blocks on interactive provider or deployment setup, ask the user explicitly for the exact human step needed, then continue after they complete it. For UI-facing auth flows, offer to validate the real sign-up or sign-in flow after setup is done. If the environment has browser automation tools, you can use them. If it does not, give the user a short manual validation checklist instead. Reference Files Provider References references/convex-auth.md references/clerk.md references/workos-authkit.md references/auth0.md Checklist Chosen the correct auth provider before writing setup code Read the relevant provider reference file Asked whether the user wants local-only setup or production-ready setup Used the official provider docs for provider-specific wiring Used the official Convex docs for shared auth behavior and authorization patterns Only added app-level user storage if the app actually needs it Did not invent a cross-provider users table or storeUser flow for Convex Auth Added authentication checks in protected backend functions Added authorization checks where the app actually needs them Clear error messages ("Not authenticated", "Unauthorized") Client auth provider configured for the chosen provider If requested, production auth setup is covered too Weekly Installs436Repositoryget-convex/agent-skillsGitHub Stars9First Seen2 days agoSecurity AuditsGen Agent Trust HubPassSocketPassSnykPassInstalled onopencode435gemini-cli435github-copilot435codex435amp435cline435

forum用户评价 (0)

发表评价

效果
易用性
文档
兼容性

暂无评价,来写第一条吧

统计数据

安装量0
评分0.0 / 5.0
版本1.0.0
更新日期2026年3月18日
对比案例1 组

用户评分

0.0(0)
5
0%
4
0%
3
0%
2
0%
1
0%

为此 Skill 评分

0.0

兼容平台

🔧Claude Code

时间线

创建2026年3月18日
最后更新2026年3月18日