mockIn static method

LoggedInUser mockIn({
  1. String mockUsername = "TESTER HUGO",
  2. String mockPasword = "what sorcery is this?",
})

Creates a mock user

Implementation

static LoggedInUser mockIn(
    {String mockUsername = "TESTER HUGO",
    String mockPasword = "what sorcery is this?"}) {
  KeyPair ecdhKeypair = KeyPair.fresh();

  AccessToken token = AccessToken("LIES!!!");
  AuthDataWatcher.instance.whenAccessTokenExpired(token.token!, DateTime(200),
      (newToken, expiresAt) {
    token.refreshWith(newToken);
  });

  return LoggedInUser(
    user: LocalityUser(mockUsername, ecdhKeypair.publicKeyHex),
    accessToken: token,
    privateKey: ecdhKeypair.privateKeyHex,
  );
}