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

Accounts.onCreateUser issue #17

Closed
SachaG opened this issue Apr 3, 2016 · 5 comments
Closed

Accounts.onCreateUser issue #17

SachaG opened this issue Apr 3, 2016 · 5 comments

Comments

@SachaG
Copy link
Collaborator

SachaG commented Apr 3, 2016

You can only have a single callback hook on Accounts.onCreateUser, which leads to the following warning:

You've implemented Accounts.onCreateUser elsewhere in your application, you can therefor not use Accounts.ui.config({ onPostSignUpHook }) on the server.

What if instead of showing that warning, accounts-ui simply extended the current callback (available at Accounts._onCreateUserHook) with its own custom logic?

i.e.

Accounts.onCreateUser(() => {
  Accounts._onCreateUserHook();
  // do custom stuff here
}
@timbrandin
Copy link
Member

I've made it so that it doesn't warn unless you actually use the hook,
https://github.com/studiointeract/accounts-ui/blob/master/imports/api/server/onPostSignUpHook.js#L1

But I guess you mean we make it possible to have multiple onCreateUser() in an application, wouldn't that be better if this solution came from accounts-base instead? 💃

@SachaG
Copy link
Collaborator Author

SachaG commented Apr 3, 2016

Yeah either one these three solutions (only warn if the hook if used, run both the hook and the original callback, fix the problem at the root) works for me, since I'm not using the hook anyway :)

@timbrandin
Copy link
Member

Alright, would it be a big issue if removed the serverside version of the hook? Just now it's causing more issues than it is solving, when one already can use onCreateUser for the same thing, maybe just document how to do this in the Readme without and then remove the hook?

@SachaG
Copy link
Collaborator Author

SachaG commented Apr 3, 2016

Sounds good to me.

timbrandin added a commit that referenced this issue Apr 3, 2016
@timbrandin
Copy link
Member

https://github.com/studiointeract/accounts-ui/releases/tag/release-1.1.6

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