How to use the @accounts/server.config 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
export const initAccounts = async () => {
  let mongoAdapter = null;
  try {
    mongoAdapter = await MongoClient.connect(MONGO_URL).then(db => new MongoAdapter(db));
  }
  catch (e) {
    console.log('Failed connecting to the mongoDb ', e);
    return;
  }
  AccountsServer.config({
    tokenConfigs: {
      accessToken: {
        expiresIn: '3d',
      },
      refreshToken: {
        expiresIn: '30d',
      },
    }
  }, mongoAdapter);

  initUsers();

  return AccountsServer;
};
github RocketChat / Rocket.Chat / packages / rocketchat-accounts / server / config.js View on Github external
Meteor.startup(() => {
	const mongodb = MongoInternals.defaultRemoteCollectionDriver().mongo.db;

	const mongoAdapter = new MongoAdapter(mongodb, {
		convertUserIdToMongoObjectId: false,
	});

	AccountsServer.config({
		tokenConfigs: {
			accessToken: {
				expiresIn: '3d',
			},
			refreshToken: {
				expiresIn: '30d',
			},
		},
		passwordHashAlgorithm: 'sha256',
	}, mongoAdapter);
});