Skip to content

fix(gateway): add error handling for oidc refresh#11475

Merged
gr2m merged 3 commits intomainfrom
aayush/oidc-error
Dec 30, 2025
Merged

fix(gateway): add error handling for oidc refresh#11475
gr2m merged 3 commits intomainfrom
aayush/oidc-error

Conversation

@aayush-kapoor
Copy link
Copy Markdown
Collaborator

Background

any error encountered while refreshing the oidc token was being silently ignored. this PR surfaces the error to the user

Summary

catch the error and pass it to the user

Manual Verification

add unit test

Checklist

  • Tests have been added / updated (for bug fixes / features)
  • A patch changeset for relevant packages has been added (for bug fixes / features - run pnpm changeset in the project root)
  • I have reviewed this pull request (self-review)

} catch {
return null;
} catch (error) {
return { oidcError: error };
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not simply remove the try/catch block here and then introduce a try/catch around getGatewayAuthToken()?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

@gr2m gr2m added backport Admins only: add this label to a pull request in order to backport it to the prior version and removed backport Admins only: add this label to a pull request in order to backport it to the prior version labels Dec 30, 2025
@gr2m gr2m merged commit 1dad057 into main Dec 30, 2025
22 checks passed
@gr2m gr2m deleted the aayush/oidc-error branch December 30, 2025 20:01
@gr2m gr2m added ai/provider related to a provider package. Must be assigned together with at least one `provider/*` label provider/gateway Issues related to the @ai-sdk/gateway provider and removed ai/gateway labels Mar 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai/provider related to a provider package. Must be assigned together with at least one `provider/*` label provider/gateway Issues related to the @ai-sdk/gateway provider

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants