Class FRPolicyAbstract

Utility for processing policy failures into human readable messages.

Example:

// Create message overrides and extensions as needed
const messageCreator = {
[PolicyKey.unique]: (property: string) => (
`this is a custom message for "UNIQUE" policy of ${property}`
),
CUSTOM_POLICY: (property: string, params: any) => (
`this is a custom message for "${params.policyRequirement}" policy of ${property}`
),
};

const thisStep = await FRAuth.next(previousStep);

if (thisStep.type === StepType.LoginFailure) {
const messagesStepMethod = thisStep.getProcessedMessage(messageCreator);
const messagesClassMethod = FRPolicy.parseErrors(thisStep, messageCreator)
}

Hierarchy

  • FRPolicy

Methods

Constructors