Skip to content

Commit

Permalink
chore: pin @ory/client-fetch to 1.15.3
Browse files Browse the repository at this point in the history
chore: format
  • Loading branch information
jonas-jonas committed Oct 16, 2024
1 parent 297c31b commit 4866952
Show file tree
Hide file tree
Showing 9 changed files with 40 additions and 10 deletions.
8 changes: 7 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions packages/elements-react/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,16 @@ user authentication flows based on the data.
To feed Ory Elements with flow data you need to use Ory client.

```ts
import { frontendClient } from "@ory/client-fetch"

export function serverClientFrontend() {
// For testing purposes we're using Ory tunnel
return frontendClient("http://localhost:4000", {

const config = new Configuration({
headers: {
Accept: "application/json",
},
basePath: "http://localhost:4000",
})
return new FrontendApi(config)
}
```

Expand Down
2 changes: 1 addition & 1 deletion packages/elements-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"module": "./dist/index.mjs",
"types": "./dist/index.d.ts",
"dependencies": {
"@ory/client-fetch": "1.15.0-next.0",
"@ory/client-fetch": "1.15.3",
"clsx": "2.1.1",
"input-otp": "1.2.4",
"react-hook-form": "7.52.1",
Expand Down
23 changes: 23 additions & 0 deletions packages/elements-react/src/util/client.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
// Copyright © 2024 Ory Corp
// SPDX-License-Identifier: Apache-2.0

import {
Configuration,
ConfigurationParameters,
FrontendApi,
} from "@ory/client-fetch"

export function frontendClient(
sdkUrl: string,
opts: Partial<ConfigurationParameters> = {},
) {
const config = new Configuration({
...opts,
basePath: sdkUrl,
headers: {
Accept: "application/json",
...opts.headers,
},
})
return new FrontendApi(config)
}
2 changes: 1 addition & 1 deletion packages/elements-react/src/util/onSubmitLogin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@

import {
FlowType,
frontendClient,
handleFlowError,
LoginFlow,
loginUrl,
UpdateLoginFlowBody,
} from "@ory/client-fetch"
import { OnSubmitHandlerProps } from "./submitHandler"
import { FlowContainer } from "./flowContainer"
import { frontendClient } from "./client"

/**
* Use this method to submit a login flow. This method is used in the `onSubmit` handler of the login form.
Expand Down
2 changes: 1 addition & 1 deletion packages/elements-react/src/util/onSubmitRecovery.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

import {
FlowType,
frontendClient,
handleContinueWith,
handleFlowError,
RecoveryFlow,
Expand All @@ -12,6 +11,7 @@ import {
} from "@ory/client-fetch"
import { FlowContainer } from "./flowContainer"
import { OnSubmitHandlerProps } from "./submitHandler"
import { frontendClient } from "./client"

/**
* Use this method to submit a recovery flow. This method is used in the `onSubmit` handler of the recovery form.
Expand Down
2 changes: 1 addition & 1 deletion packages/elements-react/src/util/onSubmitRegistration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

import {
FlowType,
frontendClient,
handleContinueWith,
handleFlowError,
RegistrationFlow,
Expand All @@ -12,6 +11,7 @@ import {
} from "@ory/client-fetch"
import { FlowContainer } from "./flowContainer"
import { OnSubmitHandlerProps } from "./submitHandler"
import { frontendClient } from "./client"

/**
* Use this method to submit a registration flow. This method is used in the `onSubmit` handler of the registration form.
Expand Down
2 changes: 1 addition & 1 deletion packages/elements-react/src/util/onSubmitSettings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

import {
FlowType,
frontendClient,
handleContinueWith,
handleFlowError,
SettingsFlow,
Expand All @@ -12,6 +11,7 @@ import {
} from "@ory/client-fetch"
import { FlowContainer } from "./flowContainer"
import { OnSubmitHandlerProps } from "./submitHandler"
import { frontendClient } from "./client"

/**
* Use this method to submit a settings flow. This method is used in the `onSubmit` handler of the settings form.
Expand Down
2 changes: 1 addition & 1 deletion packages/elements-react/src/util/onSubmitVerification.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@

import {
FlowType,
frontendClient,
handleFlowError,
UpdateVerificationFlowBody,
VerificationFlow,
verificationUrl,
} from "@ory/client-fetch"
import { FlowContainer } from "./flowContainer"
import { OnSubmitHandlerProps } from "./submitHandler"
import { frontendClient } from "./client"

/**
* Use this method to submit a verification flow. This method is used in the `onSubmit` handler of the verification form.
Expand Down

0 comments on commit 4866952

Please sign in to comment.