Created
July 11, 2022 19:18
-
-
Save nesbtesh/39850b1dbbca8b82ea4f67c2653aff43 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Accounts } from "meteor/accounts-base"; | |
class blue { | |
call(name, params) { | |
return new Promise((resolve, reject) => { | |
Meteor.call(name, params, (err, resp) => { | |
if (err) reject(err); | |
else resolve(resp); | |
}); | |
}); | |
} | |
logout() { | |
return Meteor.logout(); | |
} | |
login({ email, callback, password }) { | |
return Accounts.callLoginMethod({ | |
methodArguments: [ | |
{ | |
user: { email }, | |
twoFactorPassword: Accounts._hashPassword(password), | |
}, | |
], | |
userCallback: callback, | |
}); | |
} | |
upsertUser({ profile, email, password, _id }) { | |
return this.call("users.upsert", { | |
profile, | |
email, | |
password, | |
_id, | |
}); | |
} | |
users({ limit, page, searchQuery }) { | |
return this.call("users.get", { | |
limit, | |
page, | |
searchQuery, | |
}); | |
} | |
} | |
// inialize and export | |
const Bluelagoon = new blue(); | |
export default Bluelagoon; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment