Skip to content

Commit 531a342

Browse files
committed
Do not hide the login page in the Google service (vibe-kanban 007f2131)
In the Google service, due to the ancestor class(es), the login in the oauth callback is hidden behind the spinner page ("showSpinnerPage"). Instead, it should remain visible. Also, I suspect that the actual part that should be hidden behind a spinner page which is in prepare() actually isn't. (But I'm not 100% sure.)
1 parent a133582 commit 531a342

1 file changed

Lines changed: 17 additions & 1 deletion

File tree

src/services/google.ts

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@
22
* Google service implementation with OAuth flow.
33
*/
44

5-
import type { Response, BrowserContext, Page } from 'playwright';
5+
import type { Browser, BrowserContext, Page, Response } from 'playwright';
66
import { ApiCredentialStatus, ApiCredentials, OAuthCredentials } from '../apiCredentials.js';
77
import {
88
generateLatchkeyAppName,
9+
showSpinnerPage,
910
withTempBrowserContext,
1011
type BrowserLaunchOptions,
1112
} from '../playwrightUtils.js';
@@ -504,6 +505,18 @@ class GoogleServiceSession extends BrowserFollowupServiceSession {
504505
return this.loginDetector.isLoggedIn;
505506
}
506507

508+
/**
509+
* Override to skip the spinner page since the OAuth flow requires user interaction
510+
* (granting consent on Google's authorization page).
511+
*/
512+
protected override finalizeCredentials(
513+
_browser: Browser,
514+
context: BrowserContext,
515+
oldCredentials?: ApiCredentials
516+
): Promise<ApiCredentials | null> {
517+
return this.performBrowserFollowup(context, oldCredentials);
518+
}
519+
507520
protected async performBrowserFollowup(
508521
context: BrowserContext,
509522
oldCredentials?: ApiCredentials
@@ -647,6 +660,9 @@ export class Google implements Service {
647660
// Wait for user to log in
648661
await waitForGoogleLogin(page);
649662

663+
// Show spinner while performing automated setup
664+
await showSpinnerPage(context, this.name);
665+
650666
// Create project, enable APIs, and create OAuth client
651667
const projectSlug = await createProject(page);
652668
await enableGoogleApis(page, projectSlug);

0 commit comments

Comments
 (0)