Skip to content

fix: prevent Notion OAuth popup blocking#19

Merged
jubaoliang merged 1 commit into
mainfrom
agent/notion-oauth-popup
Jul 17, 2026
Merged

fix: prevent Notion OAuth popup blocking#19
jubaoliang merged 1 commit into
mainfrom
agent/notion-oauth-popup

Conversation

@Pandakingxbc

Copy link
Copy Markdown
Collaborator

Summary

  • open the OAuth popup synchronously from the user's click, then navigate it after the authorization URL is ready
  • show a localized error when the browser blocks the popup
  • prevent duplicate authorization requests while OAuth startup is in progress
  • validate the OAuth callback message origin and close the blank popup on startup failure

Root cause

The connector UI awaited OAuth metadata discovery and dynamic client registration before calling window.open(). That delay detached popup creation from the original user gesture, so browsers could block the Notion authorization window. Repeated clicks could also create multiple pending OAuth states.

User impact

Notion one-click authorization now opens reliably. If popups are disabled, users receive an actionable message instead of seeing an apparently unresponsive button.

Validation

  • npm run lint — passed; only pre-existing React Hook warnings
  • npx tsc --noEmit — passed
  • uv run pytest tests/unit/i18n -q — 37 passed on the v0.9.9 baseline
  • production dashboard build completed successfully

@Pandakingxbc
Pandakingxbc requested a review from jubaoliang July 17, 2026 04:07
@Pandakingxbc

Copy link
Copy Markdown
Collaborator Author

修复notion授权弹窗被浏览器拦截

@jubaoliang
jubaoliang marked this pull request as ready for review July 17, 2026 06:14
@jubaoliang
jubaoliang merged commit 7d00b65 into main Jul 17, 2026
5 checks passed
jubaoliang pushed a commit that referenced this pull request Jul 17, 2026
Co-authored-by: leoxyang <leoxyang@tencent.com>
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