Skip to content

Commit

Permalink
feat: window.focus() after auth finished
Browse files Browse the repository at this point in the history
The app has a (short) timeout, while it waits to see if it can use message passing to finish auth. This adds a `window.focus()` call, so that even if the app doesn't close, we can still grab focus right after auth.
  • Loading branch information
hstove committed Feb 24, 2020
1 parent 6bb30af commit f3003f6
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions packages/connect/src/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ const setupListener = ({ popup, authRequest, finished, authURL, userSession }: L
const data: FinishedEventData = event.data;
if (data.authRequest === authRequest) {
if (finished) {
window.focus();
const { authResponse } = data;
await userSession.handlePendingSignIn(authResponse);
finished({
Expand Down

0 comments on commit f3003f6

Please sign in to comment.