Skip to content

Commit

Permalink
chore: synchronize workspaces
Browse files Browse the repository at this point in the history
  • Loading branch information
aeneasr committed Nov 13, 2024
1 parent 9ae51b4 commit b1c4d1b
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@
},
{
"kind": "Content",
"text": "{\n sdk: {\n url: string;\n };\n}"
"text": "{\n orySdkUrl?: string;\n}"
},
{
"kind": "Content",
Expand Down
22 changes: 11 additions & 11 deletions packages/elements-react/src/client/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
export function orySdkUrl() {
let baseUrl

if (process.env["NEXT_PUBLIC_ORY_SDK_URL"]) {
baseUrl = process.env["NEXT_PUBLIC_ORY_SDK_URL"]
if (process.env.NEXT_PUBLIC_ORY_SDK_URL) {
baseUrl = process.env.NEXT_PUBLIC_ORY_SDK_URL
}

if (process.env["ORY_SDK_URL"]) {
baseUrl = process.env["_ORY_SDK_URL"]
if (process.env.ORY_SDK_URL) {
baseUrl = process.env._ORY_SDK_URL
}

if (!baseUrl) {
Expand All @@ -30,7 +30,7 @@ export function orySdkUrl() {
export function isProduction() {
return (
["production", "prod"].indexOf(
process.env["VERCEL_ENV"] || process.env["NODE_ENV"] || "",
process.env.VERCEL_ENV ?? process.env.NODE_ENV ?? "",
) > -1
)
}
Expand All @@ -41,7 +41,7 @@ export function isProduction() {
*
* Currently, this is only tested for Vercel deployments.
*
* @param options
* @param options - Options for guessing the SDK URL.
*/
export function guessPotentiallyProxiedOrySdkUrl(options?: {
knownProxiedUrl?: string
Expand All @@ -51,19 +51,19 @@ export function guessPotentiallyProxiedOrySdkUrl(options?: {
return orySdkUrl()
}

if (process.env["VERCEL_ENV"]) {
if (process.env.VERCEL_ENV) {
// We are in vercel

// The domain name of the generated deployment URL. Example: *.vercel.app. The value does not include the protocol scheme https://.
//
// This is only available for preview deployments on Vercel.
if (!isProduction() && process.env["VERCEL_URL"]) {
return `https://${process.env["VERCEL_URL"]}`.replace(/\/$/, "")
if (!isProduction() && process.env.VERCEL_URL) {
return `https://${process.env.VERCEL_URL}`.replace(/\/$/, "")
}

// This is sometimes set by the render server.
if (process.env["__NEXT_PRIVATE_ORIGIN"]) {
return process.env["__NEXT_PRIVATE_ORIGIN"].replace(/\/$/, "")
if (process.env.__NEXT_PRIVATE_ORIGIN) {
return process.env.__NEXT_PRIVATE_ORIGIN.replace(/\/$/, "")
}
}

Expand Down
2 changes: 1 addition & 1 deletion packages/elements-react/src/client/frontendClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export function frontendClient(
const config = new Configuration({
...opts,
basePath: basePath?.replace(/\/$/, ""),
credentials: opts.credentials || "include",
credentials: opts.credentials ?? "include",
headers: {
Accept: "application/json",
...opts.headers,
Expand Down

0 comments on commit b1c4d1b

Please sign in to comment.