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​

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

Parameters​

ParameterTypeRequiredDescription
userSchemaRecord<string, AttributeSchema> | null | undefined✅The user type schema resolved by the provider, keyed by attribute.
attributestring✅The credential attribute this form manages, e.g. 'password' or 'pin'.
overridePasswordPolicy❌An explicit policy supplied by the caller, which wins outright.

Returns​

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

Usage​

js
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.