@@ -132,7 +132,6 @@ export class MCPConnectionManager extends ConnectionManager {
132
132
let serviceProvider : Promise < NodeDriverServiceProvider > ;
133
133
let connectionInfo : ConnectionInfo ;
134
134
let connectionStringAuthType : ConnectionStringAuthType = "scram" ;
135
- let isOidcConnection : boolean = false ;
136
135
137
136
try {
138
137
settings = { ...settings } ;
@@ -166,7 +165,6 @@ export class MCPConnectionManager extends ConnectionManager {
166
165
connectionInfo
167
166
) ;
168
167
169
- isOidcConnection = connectionStringAuthType . startsWith ( "oidc" ) ;
170
168
serviceProvider = NodeDriverServiceProvider . connect (
171
169
connectionInfo . connectionString ,
172
170
{
@@ -189,23 +187,22 @@ export class MCPConnectionManager extends ConnectionManager {
189
187
}
190
188
191
189
try {
192
- if ( ! isOidcConnection ) {
193
- return this . changeState ( "connection-success" , {
194
- tag : "connected" ,
195
- connectedAtlasCluster : settings . atlas ,
196
- serviceProvider : await serviceProvider ,
197
- connectionStringAuthType,
198
- } ) ;
199
- } else {
200
- this . changeState ( "connection-request" , {
190
+ if ( connectionStringAuthType . startsWith ( "oidc" ) ) {
191
+ return this . changeState ( "connection-request" , {
201
192
tag : "connecting" ,
202
193
serviceProvider,
203
194
connectedAtlasCluster : settings . atlas ,
204
195
connectionStringAuthType,
205
196
oidcConnectionType : connectionStringAuthType as OIDCConnectionAuthType ,
206
197
} ) ;
207
- return this . currentConnectionState ;
208
198
}
199
+
200
+ return this . changeState ( "connection-success" , {
201
+ tag : "connected" ,
202
+ connectedAtlasCluster : settings . atlas ,
203
+ serviceProvider : await serviceProvider ,
204
+ connectionStringAuthType,
205
+ } ) ;
209
206
} catch ( error : unknown ) {
210
207
const errorReason = error instanceof Error ? error . message : `${ error as string } ` ;
211
208
this . changeState ( "connection-error" , {
0 commit comments