@@ -34,7 +34,7 @@ export async function getThunderAppClientId(): Promise<{clientId: string; applic
3434 let applicationId : string | undefined ;
3535
3636 try {
37- const result = thunderSqlite ( "SELECT APP_ID FROM SP_APP WHERE APP_NAME='React SDK Sample'" ) ;
37+ const result = thunderSqlite ( "SELECT APP_ID FROM APPLICATION WHERE APP_NAME='React SDK Sample'" ) ;
3838
3939 if ( result ) {
4040 applicationId = result ;
@@ -44,15 +44,13 @@ export async function getThunderAppClientId(): Promise<{clientId: string; applic
4444 console . warn ( '[E2E] Could not retrieve Thunder application ID from database' ) ;
4545 }
4646
47- // Patch the pre-configured app's OAuth config:
48- // 1. Add the callback URL to redirect_uris (bootstrap only has / and /dashboard)
49- // 2. Fix the token issuer to match the OIDC discovery issuer (baseUrl, not baseUrl/oauth2/token)
47+ // Patch the pre-configured app's OAuth config to add the callback URL
48+ // to redirect_uris (bootstrap only has / and /dashboard).
5049 const callbackUrl = `${ SAMPLE_APP . url } ${ SAMPLE_APP . afterSignInPath } ` ;
51- const correctIssuer = THUNDER_CONFIG . baseUrl ;
5250
5351 try {
5452 const configJson = thunderSqlite (
55- `SELECT OAUTH_CONFIG_JSON FROM IDN_OAUTH_CONSUMER_APPS WHERE CONSUMER_KEY ='${ clientId } '` ,
53+ `SELECT OAUTH_CONFIG_JSON FROM APP_OAUTH_INBOUND_CONFIG WHERE CLIENT_ID ='${ clientId } '` ,
5654 ) ;
5755
5856 if ( configJson ) {
@@ -68,25 +66,19 @@ export async function getThunderAppClientId(): Promise<{clientId: string; applic
6866 needsUpdate = true ;
6967 }
7068
71- // Fix token issuer to match OIDC discovery (required for ID token validation)
72- if ( config . token ?. issuer !== correctIssuer ) {
73- config . token . issuer = correctIssuer ;
74- needsUpdate = true ;
75- }
76-
7769 if ( needsUpdate ) {
7870 const updatedJson = JSON . stringify ( config ) ;
7971
8072 // Write JSON to a temp file inside the container to avoid shell escaping issues,
8173 // then use readfile() in the SQLite UPDATE.
82- execSync (
83- `docker exec -i ${ CONTAINER } sh -c 'cat > /tmp/oauth_config.json'` ,
84- { input : updatedJson , encoding : 'utf-8' } ,
85- ) ;
74+ execSync ( `docker exec -i ${ CONTAINER } sh -c 'cat > /tmp/oauth_config.json'` , {
75+ input : updatedJson ,
76+ encoding : 'utf-8' ,
77+ } ) ;
8678 thunderSqlite (
87- `UPDATE IDN_OAUTH_CONSUMER_APPS SET OAUTH_CONFIG_JSON=readfile('/tmp/oauth_config.json') WHERE CONSUMER_KEY ='${ clientId } '` ,
79+ `UPDATE APP_OAUTH_INBOUND_CONFIG SET OAUTH_CONFIG_JSON=readfile('/tmp/oauth_config.json') WHERE CLIENT_ID ='${ clientId } '` ,
8880 ) ;
89- console . log ( `[E2E] Thunder app OAuth config updated (redirect_uris, token issuer )` ) ;
81+ console . log ( `[E2E] Thunder app OAuth config updated (redirect_uris)` ) ;
9082 }
9183 }
9284 } catch ( err ) {
0 commit comments