Skip to content

Commit

Permalink
Add force on all ConvertTo-SecureString -AsPlainText
Browse files Browse the repository at this point in the history
  • Loading branch information
MariusStorhaug committed Aug 11, 2024
1 parent 711e7fe commit 14888c5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/public/Auth/Connect-GitHubAccount.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -151,21 +151,21 @@
switch ($Mode) {
'GitHubApp' {
$settings = @{
AccessToken = ConvertTo-SecureString -AsPlainText $tokenResponse.access_token
AccessToken = ConvertTo-SecureString -AsPlainText $tokenResponse.access_token -Force
AccessTokenExpirationDate = (Get-Date).AddSeconds($tokenResponse.expires_in)
AccessTokenType = $tokenResponse.access_token -replace '_.*$', '_*'
ApiBaseUri = 'https://api.github.com'
ApiVersion = '2022-11-28'
AuthType = $AuthType
DeviceFlowType = $Mode
RefreshToken = ConvertTo-SecureString -AsPlainText $tokenResponse.refresh_token
RefreshToken = ConvertTo-SecureString -AsPlainText $tokenResponse.refresh_token -Force
RefreshTokenExpirationDate = (Get-Date).AddSeconds($tokenResponse.refresh_token_expires_in)
Scope = $tokenResponse.scope
}
}
'OAuthApp' {
$settings = @{
AccessToken = ConvertTo-SecureString -AsPlainText $tokenResponse.access_token
AccessToken = ConvertTo-SecureString -AsPlainText $tokenResponse.access_token -Force
AccessTokenType = $tokenResponse.access_token -replace '_.*$', '_*'
ApiBaseUri = 'https://api.github.com'
ApiVersion = '2022-11-28'
Expand Down Expand Up @@ -204,7 +204,7 @@
Reset-GitHubConfig -Scope 'Auth'
$prefix = $gitHubToken.Value -replace '_.*$', '_*'
$settings = @{
AccessToken = ConvertTo-SecureString -AsPlainText $gitHubToken.Value
AccessToken = ConvertTo-SecureString -AsPlainText $gitHubToken.Value -Force
AccessTokenType = $prefix
ApiBaseUri = 'https://api.github.com'
ApiVersion = '2022-11-28'
Expand Down

0 comments on commit 14888c5

Please sign in to comment.