Skip to content

Commit

Permalink
feat: prevent proxy when specifying NEXT_PUBLIC_ORY_KRATOS_URL (#61)
Browse files Browse the repository at this point in the history
  • Loading branch information
Benehiko authored Oct 2, 2023
1 parent 56cfd24 commit 76060e7
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion pkg/sdk/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
import { Configuration, FrontendApi } from "@ory/client"
import { edgeConfig } from "@ory/integrations/next"

export default new FrontendApi(new Configuration(edgeConfig))
const localConfig = {
basePath: process.env.NEXT_PUBLIC_KRATOS_PUBLIC_URL,
}

export default new FrontendApi(
new Configuration(
process.env.NEXT_PUBLIC_KRATOS_PUBLIC_URL ? localConfig : edgeConfig,
),
)

0 comments on commit 76060e7

Please sign in to comment.