authenticateSteam method

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

Implementation

@override
Future<model.Session> authenticateSteam({
  required String token,
  bool create = true,
  String? username,
  Map<String, String>? vars,
}) async {
  final res = await _api.nakamaAuthenticateSteam(
    body: ApiAccountSteam(token: token, vars: vars),
    create: create,
    username: username,
  );

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

  final data = res.body!;

  return model.Session(
    created: data.created ?? false,
    token: data.token!,
    refreshToken: data.refreshToken,
  );
}