@nevis-security/nevis-mobile-authentication-sdk-react
Version:
React Native plugin for Nevis Mobile Authentication SDK. Supports only mobile.
34 lines (31 loc) • 1.11 kB
text/typescript
/**
* Copyright © 2023 Nevis Security AG. All rights reserved.
*/
import type { AccountSelectionContext } from './AccountSelectionContext';
import type { AccountSelectionHandler } from './AccountSelectionHandler';
/**
* The object in charge of selecting an account.
*
* This interface must be implemented by the user of the SDK only when
* username-less out-of-band authentication is required with multiple accounts.
*
* @group User Interaction
* @category Account Selection
* @see {@link OutOfBandAuthentication.accountSelector}
*/
export abstract class AccountSelector {
/**
* The account selection interaction.
*
* The implementing class must ask the user to choose one of the accounts
* exposed by the {@link AccountSelectionContext} and provide the choice to the
* {@link AccountSelectionHandler}.
*
* @param context the object containing the list of existing accounts and authenticators.
* @param handler the object that must be notified with the selection result.
*/
abstract selectAccount(
context: AccountSelectionContext,
handler: AccountSelectionHandler
): void;
}