File tree Expand file tree Collapse file tree 2 files changed +4
-5
lines changed
Expand file tree Collapse file tree 2 files changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -621,7 +621,7 @@ pub async fn is_idc_user(database: &Database) -> Result<bool> {
621621 if let Ok ( Some ( token) ) = BuilderIdToken :: load ( database) . await {
622622 Ok ( token. token_type ( ) == TokenType :: IamIdentityCenter )
623623 } else {
624- Err ( eyre ! ( "No auth token found - is the user signed in?" ) )
624+ Ok ( false )
625625 }
626626}
627627
Original file line number Diff line number Diff line change @@ -32,6 +32,7 @@ use crate::auth::builder_id::{
3232 BuilderIdToken ,
3333 PollCreateToken ,
3434 TokenType ,
35+ is_idc_user,
3536 poll_create_token,
3637 start_device_authorization,
3738} ;
@@ -338,10 +339,8 @@ pub enum LicenseType {
338339}
339340
340341pub async fn profile ( os : & mut Os ) -> Result < ExitCode > {
341- if let Ok ( Some ( token) ) = BuilderIdToken :: load ( & os. database ) . await {
342- if matches ! ( token. token_type( ) , TokenType :: BuilderId ) {
343- bail ! ( "This command is only available for Pro users" ) ;
344- }
342+ if !is_idc_user ( & os. database ) . await ? {
343+ bail ! ( "This command is only available for IAM Identity Center users" ) ;
345344 }
346345
347346 select_profile_interactive ( os, false ) . await ?;
You can’t perform that action at this time.
0 commit comments