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 {
11
11
} from "openid-client" ;
12
12
import { createRemoteJWKSet , jwtVerify } from "jose" ;
13
13
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" ;
17
16
18
17
let clientPromise : Promise < Configuration > | undefined ;
19
18
let jwks : ReturnType < typeof createRemoteJWKSet > | undefined ;
@@ -25,12 +24,22 @@ export async function getOidcConfiguration(): Promise<Configuration> {
25
24
26
25
clientPromise = ( async ( ) => {
27
26
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
+ }
28
37
const configuration = await discovery (
29
38
new URL ( OIDC_ISSUER ) ,
30
- OIDC_CLIENT_ID ,
39
+ oidcClientId ,
31
40
{
32
- client_id : OIDC_CLIENT_ID ,
33
- client_secret : OIDC_CLIENT_SECRET ,
41
+ client_id : oidcClientId ,
42
+ client_secret : oidcClientSecret ,
34
43
} ,
35
44
undefined ,
36
45
{
You can’t perform that action at this time.
0 commit comments