@@ -29,7 +29,6 @@ import type {
2929 AuthResponse ,
3030 DeviceFlowErrorResponse ,
3131 DeviceFlowSession ,
32- LoginOAuthDeviceOptions ,
3332 LoginOAuthWebOptions ,
3433} from './types' ;
3534
@@ -88,21 +87,19 @@ export function performGitHubWebOAuth(
8887 } ) ;
8988}
9089
91- export async function startGitHubDeviceFlow (
92- authOptions : LoginOAuthDeviceOptions = Constants . OAUTH_DEVICE_FLOW ,
93- ) : Promise < DeviceFlowSession > {
90+ export async function startGitHubDeviceFlow ( ) : Promise < DeviceFlowSession > {
9491 const deviceCode = await createDeviceCode ( {
9592 clientType : 'oauth-app' as const ,
96- clientId : authOptions . clientId ,
93+ clientId : Constants . OAUTH_DEVICE_FLOW_CLIENT_ID ,
9794 scopes : Constants . OAUTH_SCOPES . RECOMMENDED ,
9895 request : request . defaults ( {
99- baseUrl : getGitHubAuthBaseUrl ( authOptions . hostname ) . toString ( ) ,
96+ baseUrl : getGitHubAuthBaseUrl ( Constants . GITHUB_HOSTNAME ) . toString ( ) ,
10097 } ) ,
10198 } ) ;
10299
103100 return {
104- hostname : authOptions . hostname ,
105- clientId : authOptions . clientId ,
101+ hostname : Constants . GITHUB_HOSTNAME ,
102+ clientId : Constants . OAUTH_DEVICE_FLOW_CLIENT_ID ,
106103 deviceCode : deviceCode . data . device_code ,
107104 userCode : deviceCode . data . user_code ,
108105 verificationUri : deviceCode . data . verification_uri ,
@@ -391,7 +388,7 @@ export function getAccountUUID(account: Account): AccountUUID {
391388 * Return the primary (first) account hostname
392389 */
393390export function getPrimaryAccountHostname ( auth : AuthState ) {
394- return auth . accounts [ 0 ] ?. hostname ?? Constants . OAUTH_DEVICE_FLOW . hostname ;
391+ return auth . accounts [ 0 ] ?. hostname ?? Constants . GITHUB_HOSTNAME ;
395392}
396393
397394export function hasAccounts ( auth : AuthState ) {
0 commit comments