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 res = await _api.v2AccountAuthenticateSteamPost(
    body: ApiAccountSteam(token: token, vars: vars),
    create: create,
    username: username,
    $sync: import,
  );

  if (res.body == null) {
    throw Exception('Authentication failed.');
  }

  final data = res.body!;

  return model.Session.fromApi(data);
}