File tree Expand file tree Collapse file tree 1 file changed +15
-6
lines changed Expand file tree Collapse file tree 1 file changed +15
-6
lines changed Original file line number Diff line number Diff line change @@ -11,9 +11,8 @@ import {
1111} from "openid-client" ;
1212import { createRemoteJWKSet , jwtVerify } from "jose" ;
1313
14- export const OIDC_ISSUER = "http://localhost:4000" ;
15- const OIDC_CLIENT_ID = "my_web_app1" ;
16- const OIDC_CLIENT_SECRET = "super_secret_client_secret1" ;
14+ export const OIDC_ISSUER =
15+ process . env . OIDC_ISSUER || "https://marketplace.vercel.com" ;
1716
1817let clientPromise : Promise < Configuration > | undefined ;
1918let jwks : ReturnType < typeof createRemoteJWKSet > | undefined ;
@@ -25,12 +24,22 @@ export async function getOidcConfiguration(): Promise<Configuration> {
2524
2625 clientPromise = ( async ( ) => {
2726 try {
27+ const oidcClientId = process . env . INTEGRATION_CLIENT_ID ;
28+ if ( ! oidcClientId ) {
29+ throw new Error ( "Missing INTEGRATION_CLIENT_ID environment variable" ) ;
30+ }
31+ const oidcClientSecret = process . env . INTEGRATION_CLIENT_SECRET ;
32+ if ( ! oidcClientSecret ) {
33+ throw new Error (
34+ "Missing INTEGRATION_CLIENT_SECRET environment variable"
35+ ) ;
36+ }
2837 const configuration = await discovery (
2938 new URL ( OIDC_ISSUER ) ,
30- OIDC_CLIENT_ID ,
39+ oidcClientId ,
3140 {
32- client_id : OIDC_CLIENT_ID ,
33- client_secret : OIDC_CLIENT_SECRET ,
41+ client_id : oidcClientId ,
42+ client_secret : oidcClientSecret ,
3443 } ,
3544 undefined ,
3645 {
You can’t perform that action at this time.
0 commit comments