realm-js/tests/js/admin-user-helper.js

23 lines
523 B
JavaScript
Raw Normal View History

'use strict';
function node_require(module) {
return require(module);
2017-07-07 10:54:58 +00:00
}
const Realm = node_require('realm');
2017-09-18 06:40:46 +00:00
const adminName = "realm-admin"
const password = '';
exports.createAdminUser = function () {
return Realm.Sync.User.login('http://localhost:9080', adminName, password).then((user) => {
if (!user.isAdmin) {
throw new Error(`${adminName} user is not an admin user on this server`);
}
2017-09-18 06:40:46 +00:00
return {
username: adminName,
password
};
});
}