Created
May 26, 2016 15:01
-
-
Save flippyhead/ac839094f3d82f672dfd75ab69770c44 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
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