Skip to content

fix(auth): reject OAuth promise when popup is closed without completing login#1275

Open
deepak0x wants to merge 2 commits intoRocketChat:developfrom
deepak0x:fix/oauth-popup-promise-hang
Open

fix(auth): reject OAuth promise when popup is closed without completing login#1275
deepak0x wants to merge 2 commits intoRocketChat:developfrom
deepak0x:fix/oauth-popup-promise-hang

Conversation

@deepak0x
Copy link
Copy Markdown
Contributor

@deepak0x deepak0x commented Apr 6, 2026

Fixes #1274

The OAuth login in loginWithRocketChatOAuth.ts returns a promise that only has a resolve path. If the user closes the popup without finishing login, the setInterval detects it, cleans up the listener, and then does nothing. Promise just sits there.

The caller in ChatInput.js does await RCInstance.auth.loginWithRocketChatOAuth() inside a try/catch, but the promise never rejects so the catch never fires. User closes the popup and gets no feedback at all.

This adds reject to the promise constructor and calls it when the popup closes without completing OAuth. The catch block in ChatInput.js runs now and the user sees an error message.

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.

bug: OAuth login promise hangs forever if user closes popup without completing login

1 participant