Skip to content

Commit

Permalink
Change env credentials to be returned with same std properties
Browse files Browse the repository at this point in the history
  • Loading branch information
rrg92 committed Nov 28, 2024
1 parent cd7517a commit 2cbaa2f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
2 changes: 1 addition & 1 deletion powershai/AiCredentials.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,7 @@ function Get-AiDefaultCredential {
if($EnvValue){
verbose "Found credential in environment variable $VarName";
$Sources += @{
credential = $EnvValue
credential = @{ credential = $EnvValue }
source = "environment"
desc = "environment $VarName"
};
Expand Down
6 changes: 1 addition & 5 deletions powershai/providers/openai.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -137,11 +137,7 @@ function GetCurrentOpenaiToken {
}

if($Credential){
if($Credential.source -eq "environment"){
return $Credential.credential;
} else {
return $Credential.credential.GetCredential()
}
return $Credential.credential.credential;
} else {
write-warning "No default credential was found. Failback to deprecated method. Check if you have multiple creds and set a default credentials!"
}
Expand Down

0 comments on commit 2cbaa2f

Please sign in to comment.