@leancodepl/kratos
Version:
Headless React components library for building Ory Kratos authentication flows
52 lines (51 loc) • 2.12 kB
TypeScript
import { ContinueWith, ContinueWithRecoveryUi, ContinueWithRedirectBrowserTo, ContinueWithSetOrySessionToken, ContinueWithSettingsUi, ContinueWithVerificationUi } from "../api.generated";
export type OnRedirectHandler = (url: string, external: boolean) => void;
export declare function handleContinueWith(continueWith: ContinueWith[] | undefined, { onRedirect }: {
onRedirect: OnRedirectHandler;
}): boolean;
/**
* Picks the best continue with action from the list of continue with actions.
*
* @param continueWith - The list of continue with actions.
*/
export declare function pickBestContinueWith(continueWith: ContinueWith[]): ContinueWith | undefined;
/**
* Checks if the continue with action is to set the Ory Session Token.
*
* @param continueWith - The continue with action.
*/
export declare function isSetOrySessionToken(continueWith: ContinueWith): continueWith is ContinueWithSetOrySessionToken & {
action: "set_ory_session_token";
};
/**
* Checks if the continue with action is to redirect the browser to a different page.
*
* @param continueWith - The continue with action.
*/
export declare function isRedirectBrowserTo(continueWith: ContinueWith): continueWith is ContinueWithRedirectBrowserTo & {
action: "redirect_browser_to";
};
/**
* Checks if the continue with action is to show the recovery UI.
*
* @param continueWith - The continue with action.
*/
export declare function isShowRecoveryUi(continueWith: ContinueWith): continueWith is ContinueWithRecoveryUi & {
action: "show_recovery_ui";
};
/**
* Checks if the continue with action is to show the settings UI.
*
* @param continueWith - The continue with action.
*/
export declare function isShowSettingsUi(continueWith: ContinueWith): continueWith is ContinueWithSettingsUi & {
action: "show_settings_ui";
};
/**
* Checks if the continue with action is to show the verification UI.
*
* @param continueWith - The continue with action.
*/
export declare function isShowVerificationUi(continueWith: ContinueWith): continueWith is ContinueWithVerificationUi & {
action: "show_verification_ui";
};