getIdToken method

Future<String> getIdToken({
  1. int lifespan = 900,
})

Returns Future of String, Generates a Decentralized Id Token which acts as a proof of authentication to resource servers.

Implementation

Future<String> getIdToken({int lifespan = 900}) async {
  var params = {
    'lifespan': lifespan,
  };
  return sendToProvider(
      method: UserMethod.magic_auth_get_id_token,
      params: [params]).then((jsMsg) {
    var relayerResponse = RelayerResponse<String>.fromJson(
        json.decode(jsMsg.message), (json) => json as String);
    return relayerResponse.response.result;
  });
}