Skip to content

Fix password-reset rate-limit UX & add robust email-confirm route#91

Merged
ben-fornefeld merged 6 commits into
e2b-dev:bug-handle-password-reset-rate-limit-error-message-e2b-2619from
ben-fornefeld:bug-handle-password-reset-rate-limit-error-message-e2b-2619
Jul 6, 2025
Merged

Fix password-reset rate-limit UX & add robust email-confirm route#91
ben-fornefeld merged 6 commits into
e2b-dev:bug-handle-password-reset-rate-limit-error-message-e2b-2619from
ben-fornefeld:bug-handle-password-reset-rate-limit-error-message-e2b-2619

Conversation

@ben-fornefeld
Copy link
Copy Markdown
Member

@ben-fornefeld ben-fornefeld commented Jul 6, 2025

This PR refactors our authentication flow to improve both user experience and security.

Key changes

  • Hardened redirect logic in the auth callback & confirm routes (origin checks, graceful fallbacks).
  • Enhanced server-side logging for easier debugging of auth issues.

…n route

This commit simplifies the cookie domain management by directly using the request's origin instead of calculating the base domain from the redirect URL. This change enhances the clarity and reliability of cookie settings during the authentication process.
This commit introduces a check for a confirmation URL in the authentication confirmation process, allowing for direct redirection when provided. It also simplifies the OTP verification by removing unnecessary cookie handling, improving the overall clarity and efficiency of the authentication flow.
…mation route

This commit introduces a check for different origins in the redirect logic, improving the handling of absolute URLs. It also adds logging for key parameters during the authentication confirmation process, enhancing visibility and debugging capabilities. Additionally, it refines the fallback mechanism for constructing redirect URLs, ensuring robustness in various scenarios.
…mation route

This commit adds additional logging for various stages of the authentication confirmation process, including successful and error cases. It improves the handling of invalid parameters by logging specific details, and refines the logging of redirect URLs and errors during OTP verification, enhancing overall visibility and debugging capabilities.
…nfirmation route

This commit modifies the origin check in the redirect logic by utilizing a new BASE_URL constant. This change enhances the clarity of the origin comparison, ensuring that the authentication confirmation process correctly handles different origins for redirect URLs.
…ation confirmation route

This commit introduces a normalization function for the origin comparison in the redirect logic, ensuring consistent handling of different origins. This enhancement improves the accuracy of the origin check when processing redirect URLs, contributing to a more robust authentication flow.
@ben-fornefeld ben-fornefeld requested a review from mishushakov July 6, 2025 12:59
@ben-fornefeld ben-fornefeld self-assigned this Jul 6, 2025
@vercel
Copy link
Copy Markdown

vercel Bot commented Jul 6, 2025

@ben-fornefeld is attempting to deploy a commit to the E2B Team on Vercel.

A member of the Team first needs to authorize it.

@ben-fornefeld ben-fornefeld merged commit c0a0dc0 into e2b-dev:bug-handle-password-reset-rate-limit-error-message-e2b-2619 Jul 6, 2025
0 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants