Repository navigation
v5.14.0
Step-up authentication
Ask a signed-in user for a stronger or more recent sign-in before a sensitive action.
const { hasAuthenticationContext, stepUp } = useKindeAuth();
const requirement = { acr: "mfa", maxAge: 300 } as const;
if (!(await hasAuthenticationContext(requirement))) {
await stepUp(requirement);
}- New hook methods:
stepUp,getAuthenticationContext,hasAuthenticationContext,isStepUpSupported,handleStepUpChallenge. ProtectedRouteacceptsacrandmaxAge.- New
<StepUpLink>component. login()andregister()acceptacrValuesandmaxAge.- Your Kinde environment must support step-up for
acr. Check withisStepUpSupported(). - For
handleStepUpChallenge, your API must sendAccess-Control-Expose-Headers: WWW-Authenticate.
See Step-up authentication in the README for details.
Changes
login()URL errors now go toonErrorasERR_LOGINinstead of rejecting.unmet_authentication_requirementsandlogin_requiredcallback errors now reachonError, with a newcausefield.@kinde/js-utilsupdated to 0.33.0.
Full changelog: v5.13.2...v5.14.0