accounts-fake-client.js 476 B

123456789101112131415161718192021
  1. // Write your package code here!
  2. Meteor.loginWithFake = function (arg1, arg2) {
  3. let options, callback;
  4. // Support a callback without options
  5. if (!arg2 && typeof arg1 === "function") {
  6. callback = arg1;
  7. options = [];
  8. }
  9. else {
  10. options = arg1;
  11. callback = arg2;
  12. }
  13. // Other options:
  14. // - methodName: "login"
  15. // - suppressLoggingIn: false
  16. Accounts.callLoginMethod({
  17. methodArguments: [{ "fake": options }],
  18. userCallback: callback
  19. });
  20. };