UNPKG

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

Version:

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

50 lines (46 loc) 1.62 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.PasswordEnrollmentContext = void 0; var _PasswordEnrollmentErrorConverter = require("../../error/password/enrollment/PasswordEnrollmentErrorConverter"); /** * Copyright © 2024 Nevis Security AG. All rights reserved. */ /** * The object providing some contextual information during password enrollment. * * @see {@link PasswordEnroller.enrollPassword} */ class PasswordEnrollmentContext { /** * The username associated with the authenticator. */ /** * When a recoverable error occurred during the last password enrollment, this method returns the * object describing the last error. */ /** * Alternate constructor that creates an instance from a json. * * @param json contains the source for instance creation. * @returns the created instance. */ static fromJson(json) { return PasswordEnrollmentContextImpl.fromJson(json); } } exports.PasswordEnrollmentContext = PasswordEnrollmentContext; class PasswordEnrollmentContextImpl extends PasswordEnrollmentContext { constructor(username, lastRecoverableError) { super(); this.username = username; this.lastRecoverableError = lastRecoverableError; } static fromJson(json) { const username = json.username; const lastRecoverableError = json.lastRecoverableError && new _PasswordEnrollmentErrorConverter.PasswordEnrollmentErrorConverter(json.lastRecoverableError).convert(); return new PasswordEnrollmentContextImpl(username, lastRecoverableError); } } //# sourceMappingURL=PasswordEnrollmentContext.js.map