File tree Expand file tree Collapse file tree 3 files changed +13
-3
lines changed
src/plus/integrations/authentication Expand file tree Collapse file tree 3 files changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -27,6 +27,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
2727### Fixed
2828
2929- Fixes [ #3344 ] ( https://github.com/gitkraken/vscode-gitlens/issues/3344 ) - Make changing the AI key easier
30+ - Fixes fixes issue with Jira integration not refreshing
3031
3132## [ 15.1.0] - 2024-06-05
3233
Original file line number Diff line number Diff line change @@ -35,17 +35,26 @@ export class CloudIntegrationService {
3535
3636 async getConnectionSession (
3737 id : IntegrationId ,
38- refresh : boolean = false ,
38+ refreshToken ?: string ,
3939 ) : Promise < CloudIntegrationAuthenticationSession | undefined > {
40+ const refresh = Boolean ( refreshToken ) ;
4041 const cloudIntegrationType = toCloudIntegrationType [ id ] ;
4142 if ( cloudIntegrationType == null ) {
4243 Logger . error ( `Unsupported cloud integration type: ${ id } ` ) ;
4344 return undefined ;
4445 }
46+ const reqInitOptions = refreshToken
47+ ? {
48+ method : 'POST' ,
49+ body : JSON . stringify ( {
50+ access_token : refreshToken ,
51+ } ) ,
52+ }
53+ : { method : 'GET' } ;
4554
4655 const tokenRsp = await this . connection . fetchGkDevApi (
4756 `v1/provider-tokens/${ cloudIntegrationType } ${ refresh ? '/refresh' : '' } ` ,
48- { method : refresh ? 'POST' : 'GET' } ,
57+ reqInitOptions ,
4958 { organizationId : false } ,
5059 ) ;
5160 if ( ! tokenRsp . ok ) {
Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ export class JiraAuthenticationProvider implements IntegrationAuthenticationProv
3030 let session = await cloudIntegrations . getConnectionSession ( this . authProviderId ) ;
3131
3232 if ( session != null && session . expiresIn < 60 ) {
33- session = await cloudIntegrations . getConnectionSession ( this . authProviderId , true ) ;
33+ session = await cloudIntegrations . getConnectionSession ( this . authProviderId , session . accessToken ) ;
3434 }
3535
3636 if ( ! session && options ?. authorizeIfNeeded ) {
You can’t perform that action at this time.
0 commit comments