Skip to content

Commit

Permalink
allowlist for SSO login domains, fix Google login (#219)
Browse files Browse the repository at this point in the history
Co-authored-by: swyxio <[email protected]>
  • Loading branch information
swyxio and swyxio authored Aug 30, 2023
1 parent 47472e8 commit 3e49292
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/main/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -244,8 +244,16 @@ app.on('web-contents-created', (event, contents) => {
});
}

// Open urls in the user's browser
const domainallowlist = [
'https://accounts.google.com',
'https://login.live.com',
];
contents.setWindowOpenHandler(({ url }) => {
// return allow if url starts with domainallowlist member. for SSO
if (domainallowlist.some((domain) => url.startsWith(domain))) {
return { action: 'allow' };
}
// Open all external urls in the user's browser
setImmediate(() => {
shell.openExternal(url);
});
Expand Down
4 changes: 4 additions & 0 deletions src/providers/bard.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,10 @@ class Bard extends Provider {
}
}

static getUserAgent() {
return 'Chrome';
}

static isEnabled() {
return window.electron.electronStore.get(`${this.webviewId}Enabled`, true);
}
Expand Down

0 comments on commit 3e49292

Please sign in to comment.