Skip to content
Open
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
44 changes: 25 additions & 19 deletions apps/browser/src/background/runtime.background.ts
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,31 @@ export default class RuntimeBackground {
case "getUrlAutofillTargetingRules": {
return await this.main.domainSettingsService.getTargetingRulesForUrl(sender.tab?.url);
}
case "authResult": {
if (!(await this.isValidVaultReferrer(msg.referrer))) {
return;
}

if (msg.lastpass) {
this.messagingService.send("importCallbackLastPass", {
code: msg.code,
state: msg.state,
});
} else {
try {
await openSsoAuthResultPopout(msg);
} catch {
this.logService.error("Unable to open sso popout tab");
}
}

if (sender.tab?.id) {
await BrowserApi.closeTab(sender.tab.id).catch((error) => {
this.logService.error("Unable to close SSO tab", error);
});
}
break;
}
}
}

Expand Down Expand Up @@ -354,25 +379,6 @@ export default class RuntimeBackground {
await this.main.reseedStorage();
break;
}
case "authResult": {
if (!(await this.isValidVaultReferrer(msg.referrer))) {
return;
}

if (msg.lastpass) {
this.messagingService.send("importCallbackLastPass", {
code: msg.code,
state: msg.state,
});
} else {
try {
await openSsoAuthResultPopout(msg);
} catch {
this.logService.error("Unable to open sso popout tab");
}
}
break;
}
case "webAuthnResult": {
if (!(await this.isValidVaultReferrer(msg.referrer))) {
return;
Expand Down
Loading