Commit Graph

5 Commits

Author SHA1 Message Date
David Glasser
8a16f50138 Ensure that hook.each is called from a Fiber
That gives us enough guarantees that we can simplify the error-handling
code.

We also ensure that the "new connection" handler in livedata_server runs
in a Fiber, which fixes a bug introduced in d049bf7506 where connections
from pre-pre1 clients would crash (due to Meteor.setTimeout which only
works in a Fiber).
2014-03-17 15:49:27 -07:00
Nick Martin
af4bf909fd Add comment linking to hackpad. 2014-03-11 01:37:58 -07:00
Andrew Wilcox
2a5425fcb6 Misc login hooks code review items 2014-02-16 19:57:04 -05:00
Andrew Wilcox
f5ed36293b Clone the attempt object passed to login hooks, so the original can't
be modified by hook callbacks.

Give the Hook constructor a named option to debug print and ignore
exceptions, as just passing in a string argument to do that wasn't
very clear.
2014-02-16 19:24:15 -05:00
Andrew Wilcox
df3230c1b3 Login hooks.
Adds `Accounts.validateLoginAttempt`, `Accounts.onLogin`, and
`Accounts.onLoginFailure`.

The process for logging in a user is consolidated in accounts-base,
which is now the only package which directly accesses login tokens in
the database.

All login methods now go through `Accounts._loginMethod`, which
ensures that exceptions are captured and login hooks are called in all
cases.

The callback hook implementation code from livedata is extracted into
an internal `callback-hook` package, where it can be used by accounts.
2014-02-05 17:40:20 -05:00