Skip to content

Commit ed1301f

Browse files
committed
Fix issuer, client_id, and client_secret
1 parent ae4f73b commit ed1301f

File tree

1 file changed

+15
-6
lines changed

1 file changed

+15
-6
lines changed

app/login/vercel/issuer.ts

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,8 @@ import {
1111
} from "openid-client";
1212
import { 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

1817
let clientPromise: Promise<Configuration> | undefined;
1918
let 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
{

0 commit comments

Comments
 (0)