authenticateGoogle method

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

Implementation

@override
Future<model.Session> authenticateGoogle({
  required String token,
  bool create = true,
  String? username,
  Map<String, String>? vars,
}) async {
  final request = AuthenticateGoogleRequest()
    ..create_2 = BoolValue(value: create)
    ..account = (AccountGoogle()
      ..token = token
      ..vars.addAll(vars ?? {}));

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

  final res = await _client.authenticateGoogle(request);

  return model.Session(
    created: res.created,
    token: res.token,
    refreshToken: res.refreshToken,
  );
}