Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

is it possible that you are mixing client and server code #16

Closed
radzom opened this issue Apr 2, 2016 · 2 comments
Closed

is it possible that you are mixing client and server code #16

radzom opened this issue Apr 2, 2016 · 2 comments

Comments

@radzom
Copy link

radzom commented Apr 2, 2016

Hi in the meteor docs

Accounts.ui.config is for client side
and
Accounts.onCreateUser for server side

I do not understand how or why are you mixing them with the postSignUpHook and think this is the cause why my app broke after upgrading to accounts-ui 1.1.5
I get the error

W20160402-23:59:43.756(2)? (STDERR) Error: Can only call onCreateUser once
W20160402-23:59:43.772(2)? (STDERR)     at AccountsServer.onCreateUser (packages/accounts-base/accounts_server.js:120:13)
W20160402-23:59:43.772(2)? (STDERR)     at exports.default (server/configs/accounts_setup.js:5:12)
W20160402-23:59:43.772(2)? (STDERR)     at meteorInstall.server.main.js (server/main.js:6:1)
...
@timbrandin
Copy link
Member

The onPostSignUpHook is meant to work both client side and server side, you may use it how you wish, the implementation is done so that this code only runs on the server and if you've implemented the hook. https://github.com/studiointeract/accounts-ui/blob/master/main_server.js#L6

But I see the issue here, accounts-ui is installed first, and it'd be better if we rather removed the hook.

timbrandin added a commit that referenced this issue Apr 3, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants