@leancodepl/kratos 8.0.0 → 8.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,13 +1,12 @@
1
1
  {
2
2
  "name": "@leancodepl/kratos",
3
- "version": "8.0.0",
3
+ "version": "8.1.1",
4
4
  "license": "Apache-2.0",
5
5
  "dependencies": {
6
6
  "@ory/client": ">=1.14.3",
7
7
  "axios": ">=1.6.0",
8
8
  "lodash": ">=4.0.0",
9
9
  "react-intl": ">=6.0.0",
10
- "react-router": ">=6.0.0",
11
10
  "rxjs": ">=7.0.0",
12
11
  "yn": ">=5.0.0"
13
12
  },
@@ -1,10 +1,18 @@
1
1
  import { FrontendApi, LoginFlow, Session, UpdateLoginFlowBody } from "@ory/client";
2
- export declare function useLoginFlow({ kratosClient, loginRoute, returnTo, onLoggedIn, onSessionAlreadyAvailable, }: {
2
+ import { aalParameterName, flowIdParameterName, refreshParameterName, returnToParameterName } from "../utils/variables";
3
+ export type LoginSearchParams = {
4
+ [flowIdParameterName]?: string;
5
+ [returnToParameterName]?: string;
6
+ [refreshParameterName]?: string;
7
+ [aalParameterName]?: string;
8
+ };
9
+ export declare function useLoginFlow({ kratosClient, returnTo, onLoggedIn, onSessionAlreadyAvailable, searchParams, updateSearchParams, }: {
3
10
  kratosClient: FrontendApi;
4
- loginRoute: string;
5
11
  returnTo?: string;
6
12
  onLoggedIn?: (session: Session) => void;
7
13
  onSessionAlreadyAvailable?: () => void;
14
+ updateSearchParams: (searchParams: LoginSearchParams) => void;
15
+ searchParams?: LoginSearchParams;
8
16
  }): {
9
17
  flow: LoginFlow | undefined;
10
18
  submit: ({ body }: {
@@ -1,9 +1,15 @@
1
1
  import { ContinueWith, FrontendApi, RecoveryFlow, UpdateRecoveryFlowBody } from "@ory/client";
2
- export declare function useRecoveryFlow({ kratosClient, recoveryRoute, onSessionAlreadyAvailable, onContinueWith, }: {
2
+ import { flowIdParameterName, returnToParameterName } from "../utils/variables";
3
+ type RecoveryFlowSearchParams = {
4
+ [flowIdParameterName]?: string;
5
+ [returnToParameterName]?: string;
6
+ };
7
+ export declare function useRecoveryFlow({ kratosClient, onSessionAlreadyAvailable, onContinueWith, searchParams, updateSearchParams, }: {
3
8
  kratosClient: FrontendApi;
4
- recoveryRoute: string;
5
9
  onSessionAlreadyAvailable: () => void;
6
10
  onContinueWith?: (continueWith: ContinueWith[]) => void;
11
+ searchParams?: RecoveryFlowSearchParams;
12
+ updateSearchParams: (searchParams: RecoveryFlowSearchParams) => void;
7
13
  }): {
8
14
  flow: RecoveryFlow | undefined;
9
15
  submit: ({ body }: {
@@ -11,3 +17,4 @@ export declare function useRecoveryFlow({ kratosClient, recoveryRoute, onSession
11
17
  }) => Promise<unknown> | undefined;
12
18
  isRecovering: boolean;
13
19
  };
20
+ export {};
@@ -1,9 +1,15 @@
1
1
  import { ContinueWith, FrontendApi, RegistrationFlow, UpdateRegistrationFlowBody } from "@ory/client";
2
- export declare function useRegisterFlow({ kratosClient, registrationRoute, onSessionAlreadyAvailable, onContinueWith, }: {
2
+ import { flowIdParameterName, returnToParameterName } from "../utils/variables";
3
+ type RegistrationFlowSearchParams = {
4
+ [flowIdParameterName]?: string;
5
+ [returnToParameterName]?: string;
6
+ };
7
+ export declare function useRegisterFlow({ kratosClient, onSessionAlreadyAvailable, onContinueWith, searchParams, updateSearchParams, }: {
3
8
  kratosClient: FrontendApi;
4
- registrationRoute: string;
5
9
  onSessionAlreadyAvailable: () => void;
6
10
  onContinueWith?: (continueWith: ContinueWith[]) => void;
11
+ searchParams?: RegistrationFlowSearchParams;
12
+ updateSearchParams: (searchParams: RegistrationFlowSearchParams) => void;
7
13
  }): {
8
14
  flow: RegistrationFlow | undefined;
9
15
  submit: ({ body }: {
@@ -11,3 +17,4 @@ export declare function useRegisterFlow({ kratosClient, registrationRoute, onSes
11
17
  }) => Promise<unknown> | undefined;
12
18
  isRegistered: boolean;
13
19
  };
20
+ export {};
@@ -1,13 +1,20 @@
1
1
  import { ContinueWith, FrontendApi, SettingsFlow, UpdateSettingsFlowBody } from "@ory/client";
2
2
  import { AxiosRequestConfig } from "axios";
3
- export declare function useSettingsFlow({ kratosClient, settingsRoute, params, onContinueWith, }: {
3
+ import { flowIdParameterName, returnToParameterName } from "../utils/variables";
4
+ type SettingsFlowSearchParams = {
5
+ [flowIdParameterName]?: string;
6
+ [returnToParameterName]?: string;
7
+ };
8
+ export declare function useSettingsFlow({ kratosClient, params, onContinueWith, searchParams, updateSearchParams, }: {
4
9
  kratosClient: FrontendApi;
5
- settingsRoute: string;
6
10
  params?: AxiosRequestConfig["params"];
7
11
  onContinueWith?: (continueWith: ContinueWith[]) => void;
12
+ searchParams?: SettingsFlowSearchParams;
13
+ updateSearchParams: (searchParams: SettingsFlowSearchParams) => void;
8
14
  }): {
9
15
  flow: SettingsFlow | undefined;
10
16
  submit: ({ body }: {
11
17
  body: UpdateSettingsFlowBody;
12
18
  }) => Promise<unknown> | undefined;
13
19
  };
20
+ export {};
@@ -1,8 +1,15 @@
1
1
  import { FrontendApi, UpdateVerificationFlowBody, VerificationFlow } from "@ory/client";
2
- export declare function useVerificationFlow({ initialFlowId, kratosClient, onVerified, }: {
2
+ import { flowIdParameterName, returnToParameterName } from "../utils/variables";
3
+ type RecoveryFlowSearchParams = {
4
+ [flowIdParameterName]?: string;
5
+ [returnToParameterName]?: string;
6
+ };
7
+ export declare function useVerificationFlow({ initialFlowId, kratosClient, onVerified, searchParams, updateSearchParams, }: {
3
8
  initialFlowId?: string;
4
9
  kratosClient: FrontendApi;
5
10
  onVerified: () => void;
11
+ searchParams?: RecoveryFlowSearchParams;
12
+ updateSearchParams: (searchParams: RecoveryFlowSearchParams) => void;
6
13
  }): {
7
14
  flow: VerificationFlow | undefined;
8
15
  submit: ({ body }: {
@@ -10,3 +17,4 @@ export declare function useVerificationFlow({ initialFlowId, kratosClient, onVer
10
17
  }) => Promise<unknown> | undefined;
11
18
  reset: () => void;
12
19
  };
20
+ export {};
@@ -1,3 +1,4 @@
1
1
  export declare const returnToParameterName = "return_to";
2
2
  export declare const aalParameterName = "aal";
3
3
  export declare const flowIdParameterName = "flow";
4
+ export declare const refreshParameterName = "refresh";
@@ -1 +0,0 @@
1
- export declare function parseSearchParams(search: string): Record<string, string>;