How to use the @accounts/server.findUserByUsername function in @accounts/server

To help you get started, we’ve selected a few @accounts/server examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github RocketChat / Rocket.Chat.PWA / mock-server / accounts.ts View on Github external
users.map(async (userData) => {
    const {username, password} = userData;
    const user = await AccountsServer.findUserByUsername(username);
    if (!user) {
      AccountsServer.createUser({
        username,
        password,
        profile: {
          avatar: faker.image.avatar(),
          name: username + ' ' + username,
        }
      });
    }
  });
};