From 6e6c8505d5a1a82a3b1a1d54be5f37b8a8947651 Mon Sep 17 00:00:00 2001 From: Marius Storhaug Date: Tue, 5 Nov 2024 23:36:34 +0100 Subject: [PATCH] Update login prompts to use dynamic hostnames for GitHub login processes --- .../private/Auth/DeviceFlow/Invoke-GitHubDeviceFlowLogin.ps1 | 2 +- src/functions/public/Auth/Connect-GitHubAccount.ps1 | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/functions/private/Auth/DeviceFlow/Invoke-GitHubDeviceFlowLogin.ps1 b/src/functions/private/Auth/DeviceFlow/Invoke-GitHubDeviceFlowLogin.ps1 index 19b3c1bc7..e4b349d3b 100644 --- a/src/functions/private/Auth/DeviceFlow/Invoke-GitHubDeviceFlowLogin.ps1 +++ b/src/functions/private/Auth/DeviceFlow/Invoke-GitHubDeviceFlowLogin.ps1 @@ -55,7 +55,7 @@ Write-Host '! ' -ForegroundColor DarkYellow -NoNewline Write-Host "We added the code to your clipboard: [$userCode]" $userCode | Set-Clipboard - Read-Host 'Press Enter to open github.com in your browser...' + Read-Host "Press Enter to open $HostName in your browser..." Start-Process $verificationUri $tokenResponse = Wait-GitHubAccessToken -DeviceCode $deviceCode -ClientID $ClientID -Interval $interval -HostName $HostName diff --git a/src/functions/public/Auth/Connect-GitHubAccount.ps1 b/src/functions/public/Auth/Connect-GitHubAccount.ps1 index 38f183d33..a1c88acfc 100644 --- a/src/functions/public/Auth/Connect-GitHubAccount.ps1 +++ b/src/functions/public/Auth/Connect-GitHubAccount.ps1 @@ -211,7 +211,7 @@ Write-Verbose 'Logging in using personal access token...' Reset-GitHubConfig -Scope 'Auth' Write-Host '! ' -ForegroundColor DarkYellow -NoNewline - Start-Process 'https://github.com/settings/tokens' + Start-Process "https://$HostName/settings/tokens" $accessTokenValue = Read-Host -Prompt 'Enter your personal access token' -AsSecureString $accessTokenType = (ConvertFrom-SecureString $accessTokenValue -AsPlainText) -replace '_.*$', '_*' if ($accessTokenType -notmatch '^ghp_|^github_pat_') { @@ -229,7 +229,7 @@ break } 'App' { - Write-Verbose 'Logging in using a GitHub App...' + Write-Verbose 'Logging in as a GitHub App...' Reset-GitHubConfig -Scope 'Auth' $jwt = Get-GitHubAppJWT -ClientID $ClientID -PrivateKey $PrivateKey $settings = @{