File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ import {
10
10
getConfigValueOrUndef ,
11
11
isReadOnlyConfig ,
12
12
isTestingV1 ,
13
+ updateConfigValue ,
13
14
} from '../../utils/config.mts'
14
15
import { failMsgWithBadge } from '../../utils/fail-msg-with-badge.mts'
15
16
import { setupSdk } from '../../utils/sdk.mts'
@@ -61,8 +62,9 @@ export async function attemptLogin(
61
62
}
62
63
63
64
const orgs : SocketSdkReturnType < 'getOrganizations' > [ 'data' ] = result . data
65
+ const orgSlugs = Object . values ( orgs . organizations ) . map ( obj => obj . slug )
64
66
65
- logger . success ( `API key verified: ${ Object . values ( orgs . organizations ) } ` )
67
+ logger . success ( `API key verified: ${ orgSlugs } ` )
66
68
67
69
const enforcedChoices : OrgChoices = Object . values ( orgs . organizations )
68
70
. filter ( org => org ?. plan === 'enterprise' )
@@ -141,6 +143,8 @@ export async function attemptLogin(
141
143
}
142
144
}
143
145
146
+ updateConfigValue ( 'defaultOrg' , orgSlugs [ 0 ] )
147
+
144
148
const previousPersistedToken = getConfigValueOrUndef ( 'apiToken' )
145
149
try {
146
150
applyLogin ( apiToken , enforcedOrgs , apiBaseUrl , apiProxy )
You can’t perform that action at this time.
0 commit comments