From e8d2c636061b9b069290a1637de269b154288e18 Mon Sep 17 00:00:00 2001 From: Adam Setch Date: Mon, 20 Jan 2025 09:31:31 -0500 Subject: [PATCH] feat: log when scopes missing Signed-off-by: Adam Setch --- src/renderer/utils/auth/utils.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/renderer/utils/auth/utils.ts b/src/renderer/utils/auth/utils.ts index 124b12c2a..d0a3504ff 100644 --- a/src/renderer/utils/auth/utils.ts +++ b/src/renderer/utils/auth/utils.ts @@ -3,7 +3,7 @@ import { format } from 'date-fns'; import semver from 'semver'; import { APPLICATION } from '../../../shared/constants'; -import { logError } from '../../../shared/logger'; +import { logError, logWarn } from '../../../shared/logger'; import type { Account, AuthCode, @@ -179,6 +179,13 @@ export async function refreshAccount(account: Account): Promise { account.hasRequiredScopes = Constants.AUTH_SCOPE.every((scope) => accountScopes.includes(scope), ); + + if (!account.hasRequiredScopes) { + logWarn( + 'refreshAccount', + `account for user ${account.user.login} is missing required scopes`, + ); + } } catch (err) { logError( 'refreshAccount',