UNPKG

@nevis-security/nevis-mobile-authentication-sdk-react

Version:

React Native plugin for Nevis Mobile Authentication SDK. Supports only mobile.

49 lines (45 loc) 1.85 kB
"use strict"; /** * Copyright © 2024 Nevis Security AG. All rights reserved. */ import { UserVerificationContext } from "./UserVerificationContext.js"; import { Authenticator } from "../../localData/Authenticator.js"; import { PasswordAuthenticatorProtectionStatus } from "../password/PasswordAuthenticatorProtectionStatus.js"; /** * The object providing information about the password user verification * (i.e. the user credential validation) operation to be done. * * This object contains the information required to ask the user to authenticate: * the authenticator to be used, whether there were previous errors authenticating, etc. * * @group User Interaction * @category Password * @see {@link PasswordUserVerifier.verifyPassword} */ export class PasswordUserVerificationContext extends UserVerificationContext { /** * The authenticator protection status. */ /** * Alternate constructor that creates a {@link UserVerificationContext} from a json. * * @param json contains the source for instance creation. * @returns the created {@link PasswordUserVerificationContext} instance. */ static fromJson(json) { return PasswordUserVerificationContextImpl.fromJson(json); } } export class PasswordUserVerificationContextImpl extends PasswordUserVerificationContext { constructor(authenticator, authenticatorProtectionStatus) { super(); this.authenticator = authenticator; this.authenticatorProtectionStatus = authenticatorProtectionStatus; } static fromJson(json) { const authenticator = Authenticator.fromJson(json.authenticator); const status = PasswordAuthenticatorProtectionStatus.fromJson(json.authenticatorProtectionStatus); return new PasswordUserVerificationContextImpl(authenticator, status); } } //# sourceMappingURL=PasswordUserVerificationContext.js.map