Skip to content

Commit efe9018

Browse files
committed
fix: on conflict, update OAuth provider instead of GET to avoid silently ignoring new credentials
1 parent c0f3fd5 commit efe9018

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

src/cli/operations/identity/oauth2-credential-provider.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -104,11 +104,9 @@ export async function createOAuth2Provider(
104104
} catch (error) {
105105
const errorName = (error as { name?: string }).name;
106106
if (errorName === 'ConflictException' || errorName === 'ResourceAlreadyExistsException') {
107-
// Unlike API key providers, OAuth needs the ARN back for deployed-state.json.
108-
// This only triggers in a race condition (another process created between exists-check
109-
// and create). The caller already routes to update for known-existing providers, so
110-
// falling back to GET here is safe — the next deploy will update with fresh credentials.
111-
return getOAuth2Provider(client, params.name);
107+
// Race condition: another process created the provider between our exists-check and
108+
// create call. Fall back to update so the user's credentials are always applied.
109+
return updateOAuth2Provider(client, params);
112110
}
113111
return {
114112
success: false,

0 commit comments

Comments
 (0)