authenticateSteam method

  1. @override
Future<Session> authenticateSteam({
  1. required String token,
  2. bool create = true,
  3. String? username,
  4. Map<String, String>? vars,
  5. bool import = false,
})
override

Authenticate with steam token

Set import to true to import friends.

Implementation

@override
Future<model.Session> authenticateSteam({
  required String token,
  bool create = true,
  String? username,
  Map<String, String>? vars,
  bool import = false,
}) async {
  final request = api.AuthenticateSteamRequest()
    ..create_2 = api.BoolValue(value: create)
    ..sync = api.BoolValue(value: import)
    ..account = (api.AccountSteam()
      ..token = token
      ..vars.addAll(vars ?? {}));

  if (username != null) {
    request.username = username;
  }

  final res = await _client.authenticateSteam(request);

  return model.Session.fromDto(res);
}