MAIL_URL was overriden with database info all the time.
Now if MAIL_URL exists is not overwritten and if neither MAIL_URL nor
exists valid admin panel data MAIL_URL is not set.
MAIL_FROM was ignored. Same behaviour, env variable has bigger priority
than database configuration.
On both cases, althrought environment variable is set, updating admin-panel
mail settings will load new info and ignore the environment variable.
Remove some code that is not needed anymore
Only invited user can register in strict mode,
Set mail server in admin panel,
Switch strict mode in admin panel,
Invite people to system in admin panel
This one is a pretty strange chain of events:
* fetching /.sandstorm-login via accounts-sandstorm's rendezvous protocol
causes a user to be created in the users collection
* models/users.js has hooks to create a board and lists when a user is created
* models/activities.js has a hook to create activity entries when a list is
created
* this hook does not handle not having no boardId, which results in attempting
to run the hook with boardId: 'false'. 'false' does not have a title
attribute, which causes the whole method call to throw an exception.
* This makes the initial login fail.
While there may be other bugs, the simple fix is to not create the board and
lists when running under Sandstorm, where you only have one board anyway.
We cannot rely on the automatic userId setting of the collection hooks.
If a user is created during invitation, the userId field will contain
the id of the inviting user.
This fix this, by mocking the CollectionHooks.getUserId function and
returning the userId of the new user for all new documents after
creating the user.
The duplicated logic was nessessary because the before.insert hook was
not called before validation, when inserting was initiated on the server.
Using autoValues fixed this problem.
Meteor support that use case for us, we don't need to implement our
own validate strategy on top of that. This was also discussed as part
of the #454 review.
The bug comes for 9154b06 which this commit partially reverts. The
synchronization between the user document profile and the Sandstorm
HTTP headers is still not perfect. Having a clean model may requires
the `accounts-sandstorm` to expose a hook to modify the user document
just after the `services.sandstorm` credentials are updated.
Fixes#460
As discussed in #370 and announced in the official Eslint-meteor
plugin repository (https://github.com/dferber90/eslint-plugin-meteor),
it is recommended to not use this plugin anymore has the author has it
is currently broken and the author has abandoned it.