@nevis-security/nevis-mobile-authentication-sdk-react
Version:
React Native plugin for Nevis Mobile Authentication SDK. Supports only mobile.
34 lines (31 loc) • 1.22 kB
JavaScript
;
/**
* Copyright © 2024 Nevis Security AG. All rights reserved.
*/
import NevisMobileAuthenticationSdkReact from "../../MobileAuthenticationSdk.js";
import { OperationIdMessage } from "../../model/messages/out/OperationIdMessage.js";
import { PasswordsChangeMessage } from "../../model/messages/out/PasswordsChangeMessage.js";
import { CancellableHandler } from "../CancellableHandler.js";
/**
* The object handling the old and new password provided by the end-user.
*
* @group User Interaction
* @category Password
* @see {@link PasswordChanger.changePassword}
*/
export class PasswordChangeHandler extends CancellableHandler {}
export class PasswordChangeHandlerImpl extends PasswordChangeHandler {
constructor(operationId) {
super();
this._operationId = operationId;
}
async passwords(oldPassword, newPassword) {
const message = new PasswordsChangeMessage(this._operationId, oldPassword, newPassword);
return NevisMobileAuthenticationSdkReact.passwordsChange(message);
}
cancel() {
const message = new OperationIdMessage(this._operationId);
return NevisMobileAuthenticationSdkReact.cancel(message);
}
}
//# sourceMappingURL=PasswordChangeHandler.js.map