Skip to content

feat(auth): use system browser for GitHub SSO / OAuth authentication #1781

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

Merged
merged 17 commits into from
Jan 29, 2025
Merged
Changes from 1 commit
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
Prev Previous commit
feat: use system browser for oauth flow
Signed-off-by: Adam Setch <adam.setch@outlook.com>
  • Loading branch information
setchy committed Jan 29, 2025
commit 2d8847effd95991bb6bc97c2e49b7236b22dba08
6 changes: 2 additions & 4 deletions src/renderer/utils/auth/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,11 +120,11 @@ export async function addAccount(
newAccount = await refreshAccount(newAccount);
const newAccountUUID = getAccountUUID(newAccount);

const existingAccount = accountList.find(
const accountAlreadyExists = accountList.some(
(a) => getAccountUUID(a) === newAccountUUID,
);

if (existingAccount) {
if (accountAlreadyExists) {
logWarn(
'addAccount',
`account for user ${newAccount.user.login} already exists`,
Expand Down Expand Up @@ -152,8 +152,6 @@ export async function refreshAccount(account: Account): Promise<Account> {
try {
const res = await getAuthenticatedUser(account.hostname, account.token);

// console.log('ADAM RESPONSE', JSON.stringify(res, null, 2));

// Refresh user data
account.user = {
id: res.data.id,
Expand Down