Skip to content

[identity-kit-web] Handle popup blocker#231

Closed
jolestar wants to merge 2 commits intomainfrom
handle_window_pop
Closed

[identity-kit-web] Handle popup blocker#231
jolestar wants to merge 2 commits intomainfrom
handle_window_pop

Conversation

@jolestar
Copy link
Contributor

@jolestar jolestar commented Jul 22, 2025

resolve #224

@vercel
Copy link

vercel bot commented Jul 22, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
nuwa-docs ❌ Failed (Inspect) Jul 22, 2025 9:39am

@jolestar jolestar requested review from Mine77 and Copilot July 22, 2025 09:23
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR implements popup blocker handling for the identity-kit-web package by adding fallback mechanisms when browser popup blockers prevent the authentication window from opening. The changes provide multiple fallback strategies (redirect, copy to clipboard, manual URL handling) to ensure users can always complete the authentication flow.

  • Enhanced IdentityKitWeb.connect() method to detect popup blocking and implement fallback strategies
  • Added new React hook useIdentityKitWithFallbacks with automatic popup blocker handling and user notifications
  • Maintained backward compatibility while adding optional detailed result reporting

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
IdentityKitWeb.ts Enhanced connect method with popup blocker detection and fallback handling (redirect, copy, manual)
useIdentityKit.ts Added connectWithResult method and new useIdentityKitWithFallbacks hook with callback-based fallback handling
README.md Updated documentation with popup blocker handling examples and new hook usage patterns

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@cloudflare-workers-and-pages
Copy link

Deploying nuwa-login-demo with  Cloudflare Pages  Cloudflare Pages

Latest commit: 35deee1
Status: ✅  Deploy successful!
Preview URL: https://cf686028.nuwa-login-demo.pages.dev
Branch Preview URL: https://handle-window-pop.nuwa-login-demo.pages.dev

View logs

@jolestar jolestar closed this Sep 27, 2025
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.

Browser might prevent async calling `connect()

2 participants