supertokens-node
    Preparing search index...

    Type Alias SessionClaimValidator

    SessionClaimValidator: (
        | {
            claim: SessionClaim<any>;
            shouldRefetch: (
                payload: any,
                userContext: UserContext,
            ) => Promise<boolean> | boolean;
        }
        | {}
    ) & {
        id: string;
        validate: (
            payload: any,
            userContext: UserContext,
        ) => Promise<ClaimValidationResult>;
    }

    Type declaration

    • {
          claim: SessionClaim<any>;
          shouldRefetch: (
              payload: any,
              userContext: UserContext,
          ) => Promise<boolean> | boolean;
      }
      • claim: SessionClaim<any>
      • shouldRefetch: (payload: any, userContext: UserContext) => Promise<boolean> | boolean

        Decides if we need to refetch the claim value before checking the payload with isValid. E.g.: if the information in the payload is expired, or is not sufficient for this check.

    • {}
    • id: string
    • validate: (payload: any, userContext: UserContext) => Promise<ClaimValidationResult>

      Decides if the claim is valid based on the payload (and not checking DB or anything else)