From 7cfa8d65d8b6433b54ec39946ed606f92d2b5677 Mon Sep 17 00:00:00 2001 From: Stephan Yelle Date: Tue, 24 Jun 2025 23:56:20 -0400 Subject: [PATCH] Update StackMonkey.ps1 --- StackMonkey.ps1 | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/StackMonkey.ps1 b/StackMonkey.ps1 index b6963c4..cefbe85 100644 --- a/StackMonkey.ps1 +++ b/StackMonkey.ps1 @@ -138,7 +138,7 @@ switch ($PSCmdlet.ParameterSetName) { # 1) Fetch creds $resp = Get-DattoApiCredentials -Password $N8nPassword - if (-not $creds) { throw "Could not fetch creds" } + if (-not $resp) { throw "Could not fetch creds" } # 2) Store in globals for everyone else $Global:ApiUrl = $resp.ApiUrl @@ -445,16 +445,16 @@ function Handle-FetchSites { # 2) Fetch your Datto API creds from the webhook Write-LogHybrid "Calling webhook for Datto credentials…" "Info" "FetchSites" <# - $creds = Get-DattoApiCredentials -Password $N8nPassword - if (-not $creds) { + $resp = Get-DattoApiCredentials -Password $N8nPassword + if (-not $resp) { Write-LogHelper "Failed to retrieve Datto API credentials from n8n" Error DattoAuth throw } # now exactly the same values are populated: - $Global:ApiUrl = $creds.ApiUrl - $Global:ApiKey = $creds.ApiKey - $Global:ApiSecretKey = $creds.ApiSecretKey + $Global:ApiUrl = $resp.ApiUrl + $Global:ApiKey = $resp.ApiKey + $Global:ApiSecretKey = $resp.ApiSecretKey Write-LogHelper "Fetched Datto API credentials from n8n" Success DattoAuth #> #could replace the following 15 lines