File tree Expand file tree Collapse file tree 1 file changed +13
-7
lines changed
Expand file tree Collapse file tree 1 file changed +13
-7
lines changed Original file line number Diff line number Diff line change @@ -238,13 +238,19 @@ pub async fn login_interactive(args: LoginArgs) -> Result<()> {
238238 Some ( LicenseType :: Free ) => AuthMethod :: BuilderId ,
239239 Some ( LicenseType :: Pro ) => AuthMethod :: IdentityCenter ,
240240 None => {
241- // No license specified, prompt the user to choose
242- let options = [ AuthMethod :: BuilderId , AuthMethod :: IdentityCenter ] ;
243- let i = match choose ( "Select login method" , & options) ? {
244- Some ( i) => i,
245- None => bail ! ( "No login method selected" ) ,
246- } ;
247- options[ i]
241+ if args. identity_provider . is_some ( ) && args. region . is_some ( ) {
242+ // If license is specified and --identity-provider and --region are specified,
243+ // the license is determined to be pro
244+ AuthMethod :: IdentityCenter
245+ } else {
246+ // --license is not specified, prompt the user to choose
247+ let options = [ AuthMethod :: BuilderId , AuthMethod :: IdentityCenter ] ;
248+ let i = match choose ( "Select login method" , & options) ? {
249+ Some ( i) => i,
250+ None => bail ! ( "No login method selected" ) ,
251+ } ;
252+ options[ i]
253+ }
248254 } ,
249255 } ;
250256
You can’t perform that action at this time.
0 commit comments