Skip to content

Commit

Permalink
Fix Scope linking into Request-GHDevCode
Browse files Browse the repository at this point in the history
  • Loading branch information
MariusStorhaug committed Sep 20, 2023
1 parent 773413f commit f6b0d1c
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/GitHub/public/DeviceFlow/Invoke-GitHubDeviceCodeLogin.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,14 @@
# https://docs.github.com/en/apps/oauth-apps/building-oauth-apps/differences-between-github-apps-and-oauth-apps
[Parameter()]
[ValidateSet('OAuthApp', 'GitHubApp')]
[string] $Mode
[string] $Mode,

# The scope of the access token, when using OAuth authentication.
# Provide the list of scopes as space-separated values.
# For more information on scopes visit:
# https://docs.github.com/en/apps/oauth-apps/building-oauth-apps/scopes-for-oauth-apps
[Parameter()]
[string] $Scope
)

$script:AuthMode = $Mode
Expand All @@ -34,9 +41,9 @@
'OAuthApp' { $script:GitHubOAuthAppClientID }
'GitHubApp' { $script:GitHubAppClientID }
}

do {
$deviceCodeResponse = Request-GitHubDeviceCode -ClientID $ClientID
$deviceCodeResponse = Request-GitHubDeviceCode -ClientID $ClientID -Scope $Scope

$deviceCode = $deviceCodeResponse.device_code
$interval = $deviceCodeResponse.interval
Expand Down

0 comments on commit f6b0d1c

Please sign in to comment.