Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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;
};
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);
});