editPasskeyName method

  1. @override
Future<Passkey> editPasskeyName(
  1. String passkeyId,
  2. String newPasskeyName
)
override

Implementation

@override
Future<Passkey> editPasskeyName(
    String passkeyId, String newPasskeyName) async {
  try {
    final objFromMap = js_util.jsify({'friendly_name': newPasskeyName});
    final resultPromise =
        passage.getCurrentUser().editDevice(passkeyId, objFromMap);
    final jsObject = await js_util.promiseToFuture(resultPromise);
    return Passkey.fromJson(jsObject);
  } catch (e) {
    throw PassageError.fromObject(
        object: e, overrideCode: PassageErrorCode.passkeyError);
  }
}