Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
2 Skipped Deployments
|
📝 WalkthroughWalkthroughThe GET handler at server/api/auth/atproto.get.ts was simplified to return the OAuth client metadata ( 🚥 Pre-merge checks | ✅ 1✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
Comment |
| prompt: create ? 'create' : undefined, | ||
| }) | ||
| return sendRedirect(event, redirectUrl.toString()) | ||
| return redirectUrl |
There was a problem hiding this comment.
Returning redirectUrl breaks the OAuth authorization flow.
OAuth requires the browser to be redirected to the authorization server. Returning the URL object directly causes it to be serialised as JSON, which prevents the redirect from occurring and breaks authentication.
If this is intentional for debugging the redirect URL in Vercel, consider logging the URL before performing the redirect instead:
🐛 Suggested fix to preserve OAuth flow whilst enabling debugging
const redirectUrl = await atclient.authorize(handle, {
scope,
prompt: create ? 'create' : undefined,
})
- return redirectUrl
+ console.log('[OAuth Debug] Redirect URL:', redirectUrl.toString())
+ return sendRedirect(event, redirectUrl.toString())📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| return redirectUrl | |
| console.log('[OAuth Debug] Redirect URL:', redirectUrl.toString()) | |
| return sendRedirect(event, redirectUrl.toString()) |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
There was a problem hiding this comment.
Actionable comments posted: 0
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
server/api/auth/atproto.get.ts (1)
70-72:⚠️ Potential issue | 🟡 MinorRemove or use the unused
createvariable to satisfy lint and avoid dead code.The CI lint warning indicates
createis unused.🧹 Proposed fix
- const create = query.create?.toString() + // const create = query.create?.toString()
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
server/api/auth/atproto.get.ts (1)
1-11:⚠️ Potential issue | 🟡 MinorResolve the lint failures by removing now-unused imports.
ESLint is currently failing for unused imports in this block. Please remove the unused imports or reintroduce their usage so the pipeline passes.
| @@ -54,77 +54,5 @@ export default defineEventHandler(async event => { | |||
|
|
|||
| const query = getQuery(event) | |||
There was a problem hiding this comment.
Remove the unused query variable to fix the lint warning.
Line 55 declares query but never uses it; this is already flagged by ESLint.
Suggested fix
- const query = getQuery(event)
+ // const query = getQuery(event) // remove if not needed📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| const query = getQuery(event) | |
| // const query = getQuery(event) // remove if not needed |
| const query = getQuery(event) |
🧰 Tools
🪛 GitHub Actions: autofix.ci
[warning] 55-55: ESLint: 'query' is declared but never used. (no-unused-vars) - Consider renaming to _query or using it.
Just checking oauth error in vercel environment