File tree Expand file tree Collapse file tree
packages/kitcn/src/auth/internal Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ ---
2+ " kitcn " : patch
3+ ---
4+
5+ ## Patches
6+
7+ - Fix noisy ` oidc-provider ` deprecation warnings from the internal Convex auth plugin.
Original file line number Diff line number Diff line change 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+ } ) ;
Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments