@@ -80,8 +80,12 @@ export class ConnectionForm extends Component<any, ConnectionFormState> {
8080 constructor ( props : any ) {
8181 super ( props )
8282 const connection = this . getConnection ( )
83+
84+ const { searchParams } = new URL ( window . location . href )
85+ const searchParamAuthMethod = searchParams . get ( 'preselectAuthMethod' )
8386 const authenticationMethod =
84- ( connection && connection . authenticationMethod ) || NATIVE
87+ searchParamAuthMethod ??
88+ ( ( connection && connection . authenticationMethod ) || NATIVE )
8589
8690 const allowedSchemes = getAllowedSchemesForHost (
8791 connection . host ,
@@ -94,13 +98,22 @@ export class ConnectionForm extends Component<any, ConnectionFormState> {
9498 host : generateBoltUrl ( allowedSchemes , connection . host ) ,
9599 authenticationMethod,
96100 isLoading : false ,
101+ connecting : false ,
97102 passwordChangeNeeded : props . passwordChangeNeeded || false ,
98103 forcePasswordChange : props . forcePasswordChange || false ,
99104 successCallback : props . onSuccess || ( ( ) => { } ) ,
100105 used : props . isConnected
101106 }
102107 }
103108
109+ componentDidMount ( ) {
110+ const { authenticationMethod } = this . state
111+ if ( authenticationMethod === NO_AUTH ) {
112+ this . connect ( ( ) => this . setState ( { connecting : false } ) )
113+ this . setState ( { connecting : true } )
114+ }
115+ }
116+
104117 getConnection ( ) {
105118 return this . props . discoveredData || this . props . frame . connectionData || { }
106119 }
@@ -395,6 +408,10 @@ export class ConnectionForm extends Component<any, ConnectionFormState> {
395408 onAuthenticationMethodChange = { this . onAuthenticationMethodChange . bind (
396409 this
397410 ) }
411+ connecting = { this . state . connecting }
412+ setIsConnecting = { ( connecting : boolean ) =>
413+ this . setState ( { connecting } )
414+ }
398415 host = { host }
399416 SSOError = { this . state . SSOError }
400417 SSOProviders = { this . state . SSOProviders || [ ] }
0 commit comments