Skip to content

Commit f9d0a3d

Browse files
authored
Merge pull request #232 from udecode/codex/231-oidc-provider-warning
2 parents c75ecef + 24ca124 commit f9d0a3d

3 files changed

Lines changed: 48 additions & 0 deletions

File tree

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
"kitcn": patch
3+
---
4+
5+
## Patches
6+
7+
- Fix noisy `oidc-provider` deprecation warnings from the internal Convex auth plugin.
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
import { expect, test } from 'bun:test';
2+
import type { AuthConfig } from 'convex/server';
3+
import { convex } from './convex-plugin';
4+
5+
test('convex suppresses the internal oidc provider deprecation warning', () => {
6+
const originalSiteUrl = process.env.CONVEX_SITE_URL;
7+
const originalWarn = console.warn;
8+
const warnings: string[] = [];
9+
10+
process.env.CONVEX_SITE_URL = 'https://convex.invalid';
11+
console.warn = (...args) => {
12+
warnings.push(args.join(' '));
13+
};
14+
15+
try {
16+
convex({
17+
authConfig: {
18+
providers: [
19+
{
20+
applicationID: 'convex',
21+
issuer: 'https://issuer.invalid',
22+
},
23+
],
24+
} as AuthConfig,
25+
});
26+
} finally {
27+
console.warn = originalWarn;
28+
if (originalSiteUrl === undefined) {
29+
delete process.env.CONVEX_SITE_URL;
30+
} else {
31+
process.env.CONVEX_SITE_URL = originalSiteUrl;
32+
}
33+
}
34+
35+
expect(
36+
warnings.some((warning) =>
37+
warning.includes('"oidc-provider" plugin is deprecated')
38+
)
39+
).toBe(false);
40+
});

packages/kitcn/src/auth/internal/convex-plugin.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ export const convex = (opts: {
100100
issuer: `${process.env.CONVEX_SITE_URL}`,
101101
jwks_uri: `${process.env.CONVEX_SITE_URL}${opts.options?.basePath ?? '/api/auth'}/convex/jwks`,
102102
},
103+
__skipDeprecationWarning: true,
103104
});
104105
const providerConfig = parseAuthConfig(opts.authConfig, opts);
105106

0 commit comments

Comments
 (0)