Skip to content

Commit c98130b

Browse files
committed
fix: save token to correct provider ID based on deployment type
Determine provider ID from auth data's enterpriseUrl field instead of using the provider.id parameter, which may not reflect the actual deployment type. This ensures tokens are saved to the correct provider (github-copilot or github-copilot-enterprise).
1 parent 9ad32c8 commit c98130b

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

index.mjs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,12 @@ export async function CopilotAuthPlugin({ client }) {
7070

7171
const tokenData = await response.json();
7272

73+
const saveProviderID = info.enterpriseUrl
74+
? "github-copilot-enterprise"
75+
: "github-copilot";
7376
await client.auth.set({
7477
path: {
75-
id: provider.id,
78+
id: saveProviderID,
7679
},
7780
body: {
7881
type: "oauth",

0 commit comments

Comments
 (0)