Skip to content

Commit 67785d6

Browse files
authored
fix: set github app dev settings correctly (#2673)
Signed-off-by: Adam Setch <adam.setch@outlook.com>
1 parent a1e4913 commit 67785d6

2 files changed

Lines changed: 7 additions & 8 deletions

File tree

src/renderer/utils/auth/utils.test.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,16 +65,16 @@ describe('renderer/utils/auth/utils.ts', () => {
6565
.spyOn(comms, 'openExternalLink')
6666
.mockImplementation(vi.fn());
6767

68+
beforeEach(() => {
69+
// Mock OAUTH_DEVICE_FLOW_CLIENT_ID value
70+
Constants.OAUTH_DEVICE_FLOW_CLIENT_ID = 'mock-oauth-client-id' as ClientID;
71+
});
72+
6873
afterEach(() => {
6974
vi.clearAllMocks();
7075
});
7176

7277
describe('performGitHubDeviceOAuth', () => {
73-
beforeEach(() => {
74-
// Mock OAUTH_DEVICE_FLOW_CLIENT_ID value
75-
Constants.OAUTH_DEVICE_FLOW_CLIENT_ID = 'FAKE_CLIENT_ID_123' as ClientID;
76-
});
77-
7878
it('should authenticate using device flow for GitHub app', async () => {
7979
createDeviceCodeMock.mockResolvedValueOnce({
8080
data: {
@@ -432,7 +432,7 @@ describe('renderer/utils/auth/utils.ts', () => {
432432
method: 'GitHub App',
433433
} as Account),
434434
).toBe(
435-
'https://github.com/settings/connections/applications/27a352516d3341cee376',
435+
'https://github.com/settings/connections/applications/mock-oauth-client-id',
436436
);
437437

438438
expect(

src/renderer/utils/auth/utils.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -314,8 +314,7 @@ export function getDeveloperSettingsURL(account: Account): Link {
314314

315315
switch (account.method) {
316316
case 'GitHub App':
317-
settingsURL.pathname =
318-
'/settings/connections/applications/27a352516d3341cee376';
317+
settingsURL.pathname = `/settings/connections/applications/${Constants.OAUTH_DEVICE_FLOW_CLIENT_ID}`;
319318
break;
320319
case 'OAuth App':
321320
settingsURL.pathname = '/settings/developers';

0 commit comments

Comments
 (0)