verifySoftwareToken method

Future<bool> verifySoftwareToken({
  1. required String totpCode,
  2. String? friendlyDeviceName,
})

This is used by an authenticated user trying to authenticate to verify a TOTP MFA

Implementation

Future<bool> verifySoftwareToken(
    {required String totpCode, String? friendlyDeviceName}) async {
  _signInUserSessionCheck();
  try {
    final data = await client!.request('VerifySoftwareToken', {
      'AccessToken': _signInUserSession!.getAccessToken().getJwtToken(),
      'UserCode': totpCode,
      'FriendlyDeviceName': friendlyDeviceName ?? 'My TOTP device',
    });

    return data['Status'] == 'SUCCESS';
  } catch (err) {
    return false;
  }
}