gitbutlerapp/gitbutler · error

The browser did not finish signing in

Error message

The browser did not finish signing in

What it means

Fires in Lite's sign-in flow when polling for the completed browser login exhausted its attempts: the app opened the login page and waited for the account to arrive via the but://login callback, but the user never finished signing in (or the callback never reached the app). The error distinguishes an incomplete login from other sign-in failures.

Solutions

  1. Retry sign-in and complete the flow in the opened browser tab before the poll times out
  2. Verify the but://login deep link can reach the app (default browser / protocol handler settings)
  3. If the login page offers a copyable token, fall back to manual token entry
Defensive patterns

Strategy: retry

When it happens

Trigger: Thrown at apps/lite/ui/src/routes/project/$id/workspace/Settings/Account.tsx:63 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of gitbutlerapp/gitbutler@58e5313667 (2026-09-18). Data as JSON: /api/errors/cf0afd097b0fed2c. Report an issue: GitHub.

Appendix: source

Thrown at apps/lite/ui/src/routes/project/$id/workspace/Settings/Account.tsx:63

		setSigningIn(true);
		setError(null);
		try {
			const login = await window.lite.getLoginToken();
			// Names the client for the login page, as apps/desktop does with its
			// build type. Without it the page can only offer a token to copy.
			const url = new URL(login.url);
			url.searchParams.set("bt", "release");
			await window.lite.openInWebBrowser(url.toString());
			// The page sends the account back over `but://login`, which the main
			// process persists, so this waits for the account to appear rather
			// than for a reply of its own.
			await pollUntilSuccess({
				attempt: async () => {
					// Signed out reads as `null` rather than an error, which would end
					// the poll on its first try. The message is only ever seen if the
					// poll then runs out of time, so it reads as the failure.
					const profile = await window.lite.getUserProfileLocal();
					if (profile === null) throw new Error("The browser did not finish signing in");
					return profile;
				},
				intervalMs: pollIntervalMs,
				timeoutMs: pollTimeoutMs,
				signal: controller.signal,
			});
			await client.invalidateQueries({ queryKey: userProfileQueryOptions.queryKey });
			await client.invalidateQueries({ queryKey: aiConfigurationQueryOptions.queryKey });
		} catch (caught) {
			// Abandoning is not a failure to report.
			if (!controller.signal.aborted) setError(errorMessageForToast(caught));
		} finally {
			if (!controller.signal.aborted) setSigningIn(false);
		}
	};

	return (
		// A card of its own rather than a row: the drawing leads, and the button sits under

View on GitHub (pinned to 58e5313667)