feat: 添加 Supabase JWT 认证#5
Merged
bbruceyuan merged 18 commits intoApeCodeAI:masterfrom Jan 13, 2026
Merged
Conversation
|
@luojiyin1987 is attempting to deploy a commit to the bbruceyuan's projects Team on Vercel. A member of the Team first needs to authorize it. |
Contributor
Author
|
我还没做详细测试 |
Contributor
Author
|
现在调通的 邮箱登录和 GitHub 账号登录。 剩下的事配置supabase 和对应平台的 appid 密钥和回调地址的事 。 @bbruceyuan |
Contributor
Author
|
现在前端还有在 dev 模式会报错 ## Error Type
Console AuthPKCECodeVerifierMissingError
## Error Message
PKCE code verifier not found in storage. This can happen if the auth flow was initiated in a different browser or device, or if the storage was cleared. For SSR frameworks (Next.js, SvelteKit, etc.), use @supabase/ssr on both the server and client to store the code verifier in cookies.
Next.js version: 16.1.1 (Turbopack)因为在 Next.js 开发模式下,useEffect 可能会被执行两次(React Strict Mode),而 exchangeCodeForSession 会消耗一次性 code_verifier。第二次再调用就会报 PKCE code verifier not found,但登录其实已经成功了。 加“一次性防抖/检查”只是为了: 消掉开发态的红色报错噪音 不改,忽略开发态报错(生产不会重复执行) |
Signed-off-by: luojiyin <luojiyin@hotmail.com>
Signed-off-by: luojiyin <luojiyin@hotmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


概述
实现基于 Supabase 的用户认证系统,前端使用
@supabase/supabase-js登录获取 JWT,后端 FastAPI 进行 JWT 校验。架构
变更内容
Backend
python-jose依赖auth.py)/auth/me端点(获取当前用户信息)/auth/check端点(检查认证状态)Frontend
@supabase/supabase-js环境变量
测试
Closes #4