diff --git a/CHANGELOG.md b/CHANGELOG.md index 9132501..884b372 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # ChangeLog +### v1.1.6 + +* Removed server side version of onPostSignUpHook, related issues: +https://github.com/studiointeract/accounts-ui/issues/17 +https://github.com/studiointeract/accounts-ui/issues/16 + ### v1.1.5 * Improving and removing redundant logging. diff --git a/README.md b/README.md index 68cf848..1b83062 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # React Accounts UI -Current version 1.1.5 +Current version 1.1.6 ## Features @@ -96,18 +96,15 @@ Accounts.ui.config({ * **changePasswordPath**    String Set the path to where you would like the link to change password to go to rather than changing the state on the current page. Can also be set as a property to the LoginForm, for i18n routes or other customization. -* **onSubmitHook**    function(error, state)    **client** +* **onSubmitHook**    function(error, state) Called when the LoginForm is being submitted: allows for custom actions to be taken on form submission. error contains possible errors occurred during the submission process, state specifies the LoginForm internal state from which the submission was triggered. A nice use case might be closing the modal or side-menu or dropdown showing LoginForm. You can get all the possible states by import `STATES` from this package. -* **onPreSignUpHook**    function(options)    **client** +* **onPreSignUpHook**    function(options) Called just before submitting the LoginForm for sign-up: allows for custom actions on the data being submitted. A nice use could be extending the user profile object accessing options.profile. to be taken on form submission. The plain text password is also provided for any reasonable use. If you return a promise, the submission will wait until you resolve it. -* **onPostSignUpHook**    func(options, user)    **client** +* **onPostSignUpHook**    func(options, user) Called client side, just after a successful user account creation, post submitting the form for sign-up: allows for custom actions on the data being submitted after we are sure a new user was successfully created. -* **onPostSignUpHook**    func(options, user)    **server** - Called server side, just after a successful user account creation, post submitting the pwdForm for sign-up: allows for custom actions on the data being submitted after we are sure a new user was successfully created. A common use might be applying roles to the user, as this is only possible after fully completing user creation in `alanning:roles`. Any extra fields added to the form is available as the first parameter, and the user is available as the second argument. *If you return the user object, this will also update the user document.* - * **onResetPasswordHook**    function() Change the default redirect behavior when the user clicks the link to reset their email sent from the system, i.e. you want a custom path for the reset password form. Default is **loginPath**. diff --git a/imports/api/server/onPostSignUpHook.js b/imports/api/server/onPostSignUpHook.js deleted file mode 100644 index 23c136a..0000000 --- a/imports/api/server/onPostSignUpHook.js +++ /dev/null @@ -1,11 +0,0 @@ -if (Accounts.ui._options.onPostSignUpHook) { - try { - Accounts.onCreateUser(function(options, user) { - let _user = Accounts.ui._options.onPostSignUpHook(options, user); - return _user || user; - return user; - }); - } catch(e) { - console.log('You\'ve implemented Accounts.onCreateUser elsewhere in your application, you can therefor not use Accounts.ui.config({ onPostSignUpHook }) on the server.'); - } -} diff --git a/main_server.js b/main_server.js index 317b95a..e322141 100644 --- a/main_server.js +++ b/main_server.js @@ -3,7 +3,6 @@ import './imports/accounts_ui.js'; import './imports/login_session.js'; import { redirect, STATES } from './imports/helpers.js'; import './imports/api/server/loginWithoutPassword.js'; -import './imports/api/server/onPostSignUpHook.js'; import './imports/api/server/servicesListPublication.js'; import './imports/startup/extra_translations.js'; diff --git a/package.js b/package.js index 8d59280..6199936 100644 --- a/package.js +++ b/package.js @@ -1,6 +1,6 @@ Package.describe({ name: 'std:accounts-ui', - version: '1.1.5', + version: '1.1.6', summary: 'Accounts UI for React in Meteor 1.3', git: 'https://github.com/studiointeract/accounts-ui', documentation: 'README.md'