Skip to content

fix(auth): add captcha auto-refresh via ApolloLink #12758

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 20, 2025
Merged

Conversation

AMoreaux
Copy link
Contributor

  • Introduced createCaptchaRefreshLink to trigger captcha token refresh automatically.
  • Removed redundant manual captcha refresh calls and integrated it into Apollo Provider.

- Introduced `createCaptchaRefreshLink` to trigger captcha token refresh automatically.
- Removed redundant manual captcha refresh calls and integrated it into Apollo Provider.
@AMoreaux AMoreaux self-assigned this Jun 20, 2025
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Summary

Added an ApolloLink-based automatic CAPTCHA token refresh system to centralize and streamline token management across the application.

  • Introduced createCaptchaRefreshLink in apollo/utils/captchaRefreshLink.ts to handle automatic CAPTCHA token refresh after operations
  • Integrated the new CAPTCHA refresh link into ApolloProvider.tsx, moving token management to Apollo middleware
  • Added post-signout CAPTCHA refresh in useAuth.ts to ensure clean state after user sessions
  • Removed manual refresh calls from sign-in/up flows, reducing code duplication and potential race conditions

4 files reviewed, 2 comments
Edit PR Review Bot Settings | Greptile

- Introduced `createCaptchaRefreshLink` to trigger captcha token refresh automatically.
- Removed redundant manual captcha refresh calls and integrated it into Apollo Provider.
Copy link
Contributor

github-actions bot commented Jun 20, 2025

🚀 Preview Environment Ready!

Your preview environment is available at: http://bore.pub:27060

This environment will automatically shut down when the PR is closed or after 5 hours.

@charlesBochet charlesBochet merged commit 2469c50 into main Jun 20, 2025
50 checks passed
@charlesBochet charlesBochet deleted the fix/captcha branch June 20, 2025 09:38
ijreilly pushed a commit that referenced this pull request Jun 20, 2025
- Introduced `createCaptchaRefreshLink` to trigger captcha token refresh
automatically.
- Removed redundant manual captcha refresh calls and integrated it into
Apollo Provider.
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