@nevis-security/nevis-mobile-authentication-sdk-react
Version:
React Native plugin for Nevis Mobile Authentication SDK. Supports only mobile.
34 lines (31 loc) • 1.24 kB
JavaScript
;
/**
* Copyright © 2023 Nevis Security AG. All rights reserved.
*/
import NevisMobileAuthenticationSdkReact from "../../MobileAuthenticationSdk.js";
import { AccountUsernameMessage } from "../../model/messages/out/AccountUsernameMessage.js";
import { OperationIdMessage } from "../../model/messages/out/OperationIdMessage.js";
import { CancellableHandler } from "../../operations/CancellableHandler.js";
/**
* The objects consuming the outcome of an interaction where the user chooses the account to be used.
*
* @group User Interaction
* @category Account Selection
* @see {@link AccountSelector.selectAccount}
*/
export class AccountSelectionHandler extends CancellableHandler {}
export class AccountSelectionHandlerImpl extends AccountSelectionHandler {
constructor(operationId) {
super();
this.operationId = operationId;
}
async username(username) {
const message = new AccountUsernameMessage(this.operationId, username);
return NevisMobileAuthenticationSdkReact.accountUsername(message);
}
cancel() {
const message = new OperationIdMessage(this.operationId);
return NevisMobileAuthenticationSdkReact.cancel(message);
}
}
//# sourceMappingURL=AccountSelectionHandler.js.map