Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PM-4284] Passkey popout is not pulling correct URI for website opened #6549

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ interface BrowserPopoutWindowService {
): Promise<void>;
closePasswordRepromptPrompt(): Promise<void>;
openFido2Popout(
senderWindowId: number,
senderWindow: chrome.tabs.Tab,
promptData: {
sessionId: string;
senderTabId: number;
Expand Down
20 changes: 13 additions & 7 deletions apps/browser/src/platform/popup/browser-popout-window.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ class BrowserPopoutWindowService implements BrowserPopupWindowServiceInterface {
}

async openFido2Popout(
senderWindowId: number,
senderWindow: chrome.tabs.Tab,
{
sessionId,
senderTabId,
Expand All @@ -114,12 +114,18 @@ class BrowserPopoutWindowService implements BrowserPopupWindowServiceInterface {
"?uilocation=popout" +
`&sessionId=${sessionId}` +
`&fallbackSupported=${fallbackSupported}` +
`&senderTabId=${senderTabId}`;

return await this.openSingleActionPopout(senderWindowId, promptWindowPath, "fido2Popout", {
width: 200,
height: 500,
});
`&senderTabId=${senderTabId}` +
`&senderUrl=${encodeURIComponent(senderWindow.url)}`;

return await this.openSingleActionPopout(
senderWindow.windowId,
promptWindowPath,
"fido2Popout",
{
width: 200,
height: 500,
}
);
}

async closeFido2Popout(): Promise<void> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ export class BrowserFido2UserInterfaceSession implements Fido2UserInterfaceSessi
)
);

const popoutId = await this.browserPopoutWindowService.openFido2Popout(this.tab.windowId, {
const popoutId = await this.browserPopoutWindowService.openFido2Popout(this.tab, {
sessionId: this.sessionId,
senderTabId: this.tab.id,
fallbackSupported: this.fallbackSupported,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ export class Fido2Component implements OnInit, OnDestroy {
map((queryParamMap) => ({
sessionId: queryParamMap.get("sessionId"),
senderTabId: queryParamMap.get("senderTabId"),
senderUrl: queryParamMap.get("senderUrl"),
}))
);

Expand All @@ -97,7 +98,7 @@ export class Fido2Component implements OnInit, OnDestroy {
concatMap(async ([queryParams, message]) => {
this.sessionId = queryParams.sessionId;
this.senderTabId = queryParams.senderTabId;

this.url = queryParams.senderUrl;
// For a 'NewSessionCreatedRequest', abort if it doesn't belong to the current session.
if (
message.type === "NewSessionCreatedRequest" &&
Expand Down Expand Up @@ -145,8 +146,6 @@ export class Fido2Component implements OnInit, OnDestroy {
concatMap(async (message) => {
switch (message.type) {
case "ConfirmNewCredentialRequest": {
const activeTabs = await BrowserApi.getActiveTabs();
this.url = activeTabs[0].url;
const equivalentDomains = this.settingsService.getEquivalentDomains(this.url);

this.ciphers = (await this.cipherService.getAllDecrypted()).filter(
Expand Down
Loading