diff --git a/src/commands/auth/device/login.ts b/src/commands/auth/device/login.ts index c39cdd39..606bbf8b 100644 --- a/src/commands/auth/device/login.ts +++ b/src/commands/auth/device/login.ts @@ -77,7 +77,7 @@ export default class Login extends SfdxCommand { const authInfo = await deviceOauthService.authorizeAndSave(approval); await Common.handleSideEffects(authInfo, this.flags); const fields = authInfo.getFields(true); - await Common.identifyPossibleScratchOrgs(fields, authInfo); + await Common.identifyPossibleScratchOrgs(authInfo); const successMsg = messages.getMessage('success', [fields.username]); this.ux.log(successMsg); return fields; diff --git a/src/commands/auth/jwt/grant.ts b/src/commands/auth/jwt/grant.ts index 56dc1c73..b6bfa740 100644 --- a/src/commands/auth/jwt/grant.ts +++ b/src/commands/auth/jwt/grant.ts @@ -70,7 +70,7 @@ export default class Grant extends SfdxCommand { const authInfo = await this.initAuthInfo(); await Common.handleSideEffects(authInfo, this.flags); result = authInfo.getFields(true); - await Common.identifyPossibleScratchOrgs(result, authInfo); + await Common.identifyPossibleScratchOrgs(authInfo); } catch (err) { const msg = getString(err, 'message'); throw SfdxError.create('@salesforce/plugin-auth', 'jwt.grant', 'JwtGrantError', [msg]); diff --git a/src/commands/auth/sfdxurl/store.ts b/src/commands/auth/sfdxurl/store.ts index 4582b0a0..4e2b03fe 100644 --- a/src/commands/auth/sfdxurl/store.ts +++ b/src/commands/auth/sfdxurl/store.ts @@ -77,7 +77,7 @@ export default class Store extends SfdxCommand { await Common.handleSideEffects(authInfo, this.flags); const result = authInfo.getFields(true); - await Common.identifyPossibleScratchOrgs(result, authInfo); + await Common.identifyPossibleScratchOrgs(authInfo); const successMsg = commonMessages.getMessage('authorizeCommandSuccess', [result.username, result.orgId]); this.ux.log(successMsg); diff --git a/src/commands/auth/web/login.ts b/src/commands/auth/web/login.ts index 71124bbf..460574f6 100644 --- a/src/commands/auth/web/login.ts +++ b/src/commands/auth/web/login.ts @@ -77,7 +77,7 @@ export default class Login extends SfdxCommand { const authInfo = await this.executeLoginFlow(oauthConfig); await Common.handleSideEffects(authInfo, this.flags); const fields = authInfo.getFields(true); - await Common.identifyPossibleScratchOrgs(fields, authInfo); + await Common.identifyPossibleScratchOrgs(authInfo); const successMsg = commonMessages.getMessage('authorizeCommandSuccess', [fields.username, fields.orgId]); this.ux.log(successMsg); diff --git a/src/common.ts b/src/common.ts index 49c22d6a..f2d88f59 100644 --- a/src/common.ts +++ b/src/common.ts @@ -6,7 +6,7 @@ */ import { basename } from 'path'; import { QueryResult } from 'jsforce'; -import { AuthInfo, AuthFields, Logger, SfdcUrl, SfdxProject, Messages, Org, SfdxError, sfdc } from '@salesforce/core'; +import { AuthInfo, Logger, SfdcUrl, SfdxProject, Messages, Org, SfdxError, sfdc } from '@salesforce/core'; import { getString, isObject, Optional } from '@salesforce/ts-types'; Messages.importMessagesDirectory(__dirname); @@ -56,7 +56,8 @@ export class Common { return loginUrl; } - public static async identifyPossibleScratchOrgs(fields: AuthFields, orgAuthInfo: AuthInfo): Promise { + public static async identifyPossibleScratchOrgs(orgAuthInfo: AuthInfo): Promise { + const fields = orgAuthInfo.getFields(); const logger = await Logger.child('Common', { tag: 'identifyPossibleScratchOrgs' }); // return if we already know the hub or we know it is a devhub or prod-like