Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(desktop): Entra sign-in offers passkeys in the preview browser #30018

Closedcveld(GitHub profile, opens in a new tab)wants to merge 6 commits intomain fromrefs/pull/30018/headopened View on GitHub

Showing 2 changed files with 29 additions and 7 deletions.

x
0 of 2 viewed, 2 left
17 additions and 2 deletionsapps/desktop/src/preview/BrowserSession.test.tsModified
View file
@@ -223,7 +223,7 @@
}).pipe(Effect.provide(layer)),
​
- it.effect("keeps the native User-Agent except for the Electron token sent to Teams", () =>
+ it.effect("strips only the Electron token from requests to Teams and Microsoft sign-in", () =>
Effect.gen(function* () {
const nativeUserAgent =
"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) T3Code(Alpha)/0.0.33 Chrome/146.0.7680.216 Electron/41.5.0 Safari/537.36";
@@ -257,7 +257,8 @@
assert.isDefined(browserSession);
assert.strictEqual(browserSession.getUserAgent(), nativeUserAgent);
​
- // Teams redirects Electron to an error page before sign-in; every other host sees the native one.
+ // Teams redirects Electron to an error page before sign-in and Microsoft sign-in hides passkeys
+ // from it; every other host sees the native one.
const calls = browserSession.webRequest.onBeforeSendHeaders.mock.calls;
assert.strictEqual(calls.length, 1);
const [filter, listener] = calls[0] ?? [];
@@ -280,8 +281,22 @@
});
assert.strictEqual(requestHeaders[key], nativeUserAgent);
+ for (const url of [
+ "https://teams.cloud.microsoft/v2/",
+ "https://login.microsoftonline.com/common/oauth2/v2.0/authorize",
+ "https://login.microsoft.com/",
+ "https://login.live.com/oauth20_authorize.srf",