Skip to content

Commit de41e5f

Browse files
committed
fix(amazonq): send sso startUrl on token update
1 parent 4ba5251 commit de41e5f

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

packages/amazonq/src/lsp/auth.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,12 @@
44
*/
55

66
import {
7+
bearerCredentialsUpdateRequestType,
78
ConnectionMetadata,
89
NotificationType,
910
RequestType,
1011
ResponseMessage,
12+
UpdateCredentialsParams,
1113
} from '@aws/language-server-runtimes/protocol'
1214
import * as jose from 'jose'
1315
import * as crypto from 'crypto'
@@ -81,7 +83,7 @@ export class AmazonQLspAuth {
8183
token,
8284
})
8385

84-
await this.client.sendRequest(notificationTypes.updateBearerToken.method, request)
86+
await this.client.sendRequest(bearerCredentialsUpdateRequestType.method, request)
8587

8688
this.client.info(`UpdateBearerToken: ${JSON.stringify(request)}`)
8789
}
@@ -96,7 +98,7 @@ export class AmazonQLspAuth {
9698
return interval
9799
}
98100

99-
private async createUpdateCredentialsRequest(data: any) {
101+
private async createUpdateCredentialsRequest(data: any): Promise<UpdateCredentialsParams> {
100102
const payload = new TextEncoder().encode(JSON.stringify({ data }))
101103

102104
const jwt = await new jose.CompactEncrypt(payload)
@@ -105,6 +107,11 @@ export class AmazonQLspAuth {
105107

106108
return {
107109
data: jwt,
110+
metadata: {
111+
sso: {
112+
startUrl: AuthUtil.instance.auth.startUrl,
113+
},
114+
},
108115
encrypted: true,
109116
}
110117
}

0 commit comments

Comments
 (0)