Skip to main content
Back to Browser

resolveChangeCredentialPolicy()

resolveChangeCredentialPolicy resolves the rules a change-credential form should enforce for a given credential: an explicit override wins outright, otherwise the attribute's own regex from the user type schema (GET /users/me/meta) applies. Returns an empty policy (no rules) when neither is set, since the SDK never layers its own character-class or length rules on top of the organization's policy.

Signature

resolveChangeCredentialPolicy(
userSchema: Record<string, AttributeSchema> | null | undefined,
attribute: string,
override?: PasswordPolicy,
): PasswordPolicy

Parameters

ParameterTypeRequiredDescription
userSchemaRecord<string, AttributeSchema> | null | undefinedThe user type schema resolved by the provider, keyed by attribute.
attributestringThe credential attribute this form manages, e.g. 'password' or 'pin'.
overridePasswordPolicyAn explicit policy supplied by the caller, which wins outright.

Returns

PasswordPolicy: the policy to hand to evaluatePasswordPolicy() or evaluateChangePasswordForm().

Usage

import { evaluatePasswordPolicy, resolveChangeCredentialPolicy } from '@thunderid/browser'

const policy = resolveChangeCredentialPolicy(userSchema, 'pin', undefined)
const results = evaluatePasswordPolicy(candidate, policy)

Explore with AI

ThunderID LogoThunderID Logo

Product

DocsAPIsSDKs
© Copyright Linux Foundation Europe.For web site terms of use, trademark policy and other project policies please see https://linuxfoundation.eu/en/policies.