Skip to content

Commit

Permalink
fix api client results
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnDuprey committed Feb 6, 2025
1 parent 5d0a4d6 commit c8870a1
Showing 1 changed file with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -117,22 +117,22 @@ function Invoke-ExecApiClient {
$Client = Get-CIPPAzDataTableEntity @Table -Filter "RowKey eq '$($Request.Body.ClientId)'"
if (!$Client) {
$Results = @{
text = 'API client not found'
severity = 'error'
resultText = 'API client not found'
severity = 'error'
}
} else {
$ApiConfig = New-CIPPAPIConfig -ResetSecret -AppId $Request.Body.ClientId

if ($ApiConfig.ApplicationSecret) {
$Results = @{
text = "API secret reset for $($Client.AppName)"
copyField = $ApiConfig.ApplicationSecret
severity = 'success'
resultText = "API secret reset for $($Client.AppName). Use the Copy to Clipboard button to retrieve the new secret."
copyField = $ApiConfig.ApplicationSecret
state = 'success'
}
} else {
$Results = @{
text = "Failed to reset secret for $($Client.AppName)"
severity = 'error'
resultText = "Failed to reset secret for $($Client.AppName)"
state = 'error'
}
}
}
Expand Down

0 comments on commit c8870a1

Please sign in to comment.