@nevis-security/nevis-mobile-authentication-sdk-react
Version:
React Native plugin for Nevis Mobile Authentication SDK. Supports only mobile.
32 lines (29 loc) • 1.16 kB
JavaScript
/**
* Copyright © 2024 Nevis Security AG. All rights reserved.
*/
import NevisMobileAuthenticationSdkReact from '../../MobileAuthenticationSdk';
import { OperationIdMessage } from '../../model/messages/out/OperationIdMessage';
import { PasswordsChangeMessage } from '../../model/messages/out/PasswordsChangeMessage';
import { CancellableHandler } from '../CancellableHandler';
/**
* The object handling the old and new password provided by the end-user.
*
* @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
;