UNPKG

@leancodepl/kratos

Version:

Headless React components library for building Ory Kratos authentication flows

88 lines (87 loc) 3.84 kB
import { ErrorBrowserLocationChangeRequired, ErrorFlowReplaced, GenericError, NeedsPrivilegedSessionError, ResponseError, SelfServiceFlowExpiredError } from "../api.generated"; export declare function isGenericErrorResponse(response: unknown): response is { error: GenericError; }; /** * Checks if the response is a NeedsPrivilegedSessionError. This error is returned when the self-service flow requires * the user to re-authenticate in order to perform an action that requires elevated privileges. * * @param response - The response to check. */ export declare function isNeedsPrivilegedSessionError(response: unknown): response is NeedsPrivilegedSessionError; /**1 * Checks if the response is a SelfServiceFlowExpiredError. This error is returned when the self-service flow is expired. * * @param response - The response to check. */ export declare function isSelfServiceFlowExpiredError(response: unknown): response is SelfServiceFlowExpiredError; /** * Checks if the response is a GenericError due to the self-service flow being disabled (for example disabled registration). * * @param response - The response to check. */ export declare function isSelfServiceFlowDisabled(response: unknown): response is GenericError; /** * Checks if the response is a ErrorBrowserLocationChangeRequired. * @param response - The response to check. */ export declare function isBrowserLocationChangeRequired(response: unknown): response is ErrorBrowserLocationChangeRequired; /** * Checks if the response is a ErrorFlowReplaced. * @param response - The response to check. */ export declare function isSelfServiceFlowReplaced(response: unknown): response is ErrorFlowReplaced; /** * Checks if the response is a GenericError due to the session already being available. * @param response - The response to check. */ export declare function isSessionAlreadyAvailable(response: unknown): response is GenericError; /** * Checks if the response is a GenericError due to the session being inactive. * * @param response - The response to check. */ export declare function isAddressNotVerified(response: unknown): response is GenericError; /** * Checks if the response is a GenericError due to the session already having fulfilled the AAL requirement. * * @param response - The response to check. */ export declare function isAalAlreadyFulfilled(response: unknown): response is GenericError; /** * Checks if the response is a GenericError due to the session requiring a higher AAL. * * @param response - The response to check. */ export declare function isSessionAal1Required(response: unknown): response is GenericError; /** * Checks if the response is a GenericError due to the session requiring a higher AAL. * * @param response - The response to check. */ export declare function isSessionAal2Required(response: unknown): response is GenericError; /** * Checks if the response is a GenericError due to the session being inactive. * * @param response - The response to check. */ export declare function isNoActiveSession(response: unknown): response is GenericError; /** * Checks if the response is a GenericError due to a CSRF violation. * * @param response - The response to check. */ export declare function isCsrfError(response: unknown): response is GenericError; /** * Checks if the response is a GenericError due to the redirect URL being forbidden. * * @param response - The response to check. */ export declare function isRedirectUrlNotAllowed(response: unknown): response is GenericError; /** * Checks if the response is a GenericError due to two sessions being active. * * @param response - The response to check. */ export declare function isSecurityIdentityMismatch(response: unknown): response is GenericError; export declare const isResponseError: (err: unknown) => err is ResponseError;