Skip to content

Instantly share code, notes, and snippets.

@flippyhead
Created May 26, 2016 15:01
Show Gist options
  • Save flippyhead/ac839094f3d82f672dfd75ab69770c44 to your computer and use it in GitHub Desktop.
Save flippyhead/ac839094f3d82f672dfd75ab69770c44 to your computer and use it in GitHub Desktop.
export const create = new ValidatedMethod({
name: 'accounts.create',
validate: SignupSchema.validator(),
run({ email, password }) {
let userId;
if (Meteor.isClient) {
// this won't login the user even though it's running in the client
Accounts.createUser({ email, password }, (error) => {
if (!error) {
// so I thought I'd try this, but it also doesn't login the user
Accounts.loginWithPassword(email, password);
}
});
} else {
userId = Accounts.createUser({ email, password });
}
},
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment