Skip to content

Commit 1f65090

Browse files
authored
Merge pull request #5 from kavhnr/fix/token-refresh-error
fix: throw error on token refresh failure instead of returning undefined
2 parents c07a453 + ab3bb3e commit 1f65090

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

index.mjs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,9 @@ export async function CopilotAuthPlugin({ client }) {
8585
},
8686
});
8787

88-
if (!response.ok) return;
88+
if (!response.ok) {
89+
throw new Error(`Token refresh failed: ${response.status}`);
90+
}
8991

9092
const tokenData = await response.json();
9193

0 commit comments

Comments
 (0)