OHIF-55: Add Test Drive button to login with demo user for Lesion Tracker

This commit is contained in:
Aysel Afsar committed 2016-08-25 12:08:40 -04:00
1 parent 4b627198b7
commit 793c2f3c0f
4 files changed
+69 -1

No files matched your search

@@ -0,0 +1,39 @@
import { Accounts } from 'meteor/accounts-base';
Meteor.startup(function() {
const options = {
email: 'demo@ohif.org',
password: '12345678aA*',
profile: {
fullName: 'Demo User'
}
};
createDemoUser = function() {
const user = Meteor.users.findOne({
emails: {
$elemMatch: {
address: 'demo@ohif.org'
}
}
});
if (user) {
return;
}
console.log('create user!');
// Create user
const userId = Accounts.createUser(options);
if (!userId) {
console.log('Demo user cannot be created');
return;
}
};
// Create demo user
createDemoUser();
});