You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Because const is block-scoped, origin is not accessible inside the catch block. If an unexpected error occurs before the redirect (for example, a Prisma connection failure), the catch block itself throws:
ReferenceError: origin is not defined
This results in a 500 response instead of a graceful redirect with an error message.
Fix
Move:
const{ origin }=getRedirectParams(req);
outside the try block so origin is available throughout the entire handler, including the catch block.
We typically do not assign issues. Instead, we accept the first pull request that comprehensively solves the issue.
Issues labeled with help wanted or first timers only are open for contributions.
Please make sure you read our guidelines for contributing. We prioritize contributors following the instructions in our guide. Join us in our chat room or the forum if you need help contributing - our community will be happy to assist you.
Reacted by Parman Mohammadalizadeh and Abhinav Pingle
Activity
fix: move origin extraction outside try block in email handlers
MannXo commentedon May 28, 2026
Interested in working on this. Can I be assigned?
Jeevankumar-s commentedon May 28, 2026
We typically do not assign issues. Instead, we accept the first pull request that comprehensively solves the issue.
Issues labeled with
help wantedorfirst timers onlyare open for contributions.Please make sure you read our guidelines for contributing. We prioritize contributors following the instructions in our guide. Join us in our chat room or the forum if you need help contributing - our community will be happy to assist you.