chore: update next auth#435
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Greptile SummaryThis PR bumps
Confidence Score: 4/5Safe to merge only if the broken resume proxy is intentional/tracked; otherwise the handler needs the auth header restored or the file removed. One P1 finding: the commented-out Authorization header leaves the Typeform proxy non-functional. All other changes (next-auth bump, TYPEFORM_API_KEY removal from schema/env) are clean. P1 ceiling is 4/5. src/pages/api/resumes/[...path].ts — Authorization header is commented out, breaking the proxy. Important Files Changed
Prompt To Fix All With AIFix the following 3 code review issues. Work through them one at a time, proposing concise fixes.
---
### Issue 1 of 3
src/pages/api/resumes/[...path].ts:20
**Commented-out auth breaks the proxy**
The `Authorization` header is commented out but the Typeform fetch call remains active. Every proxied request will now reach Typeform without credentials and receive a `401`, making this endpoint non-functional for all authorized users. If the intent is to remove Typeform entirely, delete the handler; otherwise restore the header (or replace it with the new auth mechanism).
### Issue 2 of 3
src/pages/api/resumes/[...path].ts:5
**Unused `env` import**
`env` is imported on line 5 but is no longer referenced anywhere in the file after the `TYPEFORM_API_KEY` usage was commented out. Remove the import to keep the file clean.
### Issue 3 of 3
src/pages/api/resumes/[...path].ts:37
**Wrong HTTP status for unauthorized**
Unauthenticated callers receive `400 Bad Request` instead of the semantically correct `401 Unauthorized`. Consider updating to `res.status(401)`.
Reviews (2): Last reviewed commit: "chore: remove depreciated typeform env" | Re-trigger Greptile |
| method: "GET", | ||
| headers: { | ||
| Authorization: `Bearer ${env.TYPEFORM_API_KEY}`, | ||
| // Authorization: `Bearer ${env.TYPEFORM_API_KEY}`, |
There was a problem hiding this comment.
Commented-out auth breaks the proxy
The Authorization header is commented out but the Typeform fetch call remains active. Every proxied request will now reach Typeform without credentials and receive a 401, making this endpoint non-functional for all authorized users. If the intent is to remove Typeform entirely, delete the handler; otherwise restore the header (or replace it with the new auth mechanism).
Prompt To Fix With AI
This is a comment left during a code review.
Path: src/pages/api/resumes/[...path].ts
Line: 20
Comment:
**Commented-out auth breaks the proxy**
The `Authorization` header is commented out but the Typeform fetch call remains active. Every proxied request will now reach Typeform without credentials and receive a `401`, making this endpoint non-functional for all authorized users. If the intent is to remove Typeform entirely, delete the handler; otherwise restore the header (or replace it with the new auth mechanism).
How can I resolve this? If you propose a fix, please make it concise.
main goal is to check auth proxy for preview urls