Skip to content

Commit

Permalink
fix(cors): fix profile sdk env
Browse files Browse the repository at this point in the history
  • Loading branch information
cedricmagne committed Sep 23, 2024
1 parent c6fde0a commit 32f25fb
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/lib/siwsrp/auth.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import useDocusaurusContext from "@docusaurus/useDocusaurusContext";
import { SDK } from "@metamask/profile-sync-controller";
import jwt from "jsonwebtoken";

export const customFields = {
VERCEL_ENV: process.env.VERCEL_ENV,
};

type HydraEnv = {
authApiUrl: string;
oidcApiUrl: string;
Expand All @@ -11,8 +14,8 @@ type HydraEnv = {
};

const { AuthType, Env, getEnvUrls, JwtBearerAuth, Platform } = SDK;
const { siteConfig } = useDocusaurusContext();
const { VERCEL_ENV } = siteConfig?.customFields || {};
const { VERCEL_ENV } = customFields;
console.log(VERCEL_ENV)
export const AUTH_WALLET_SESSION_NAME = "auth.wallet.session";
export const AUTH_WALLET_TOKEN = "auth.wallet.token";
export const AUTH_WALLET_PROJECTS = "auth.wallet.projects";
Expand Down Expand Up @@ -53,7 +56,7 @@ export const auth = new JwtBearerAuth(
},
{
storage,
},
}
);

export const authenticateAndAuthorize = async () => {
Expand Down

0 comments on commit 32f25fb

Please sign in to comment.