Do something whenever authentication is successful

119 views Asked by At

I need to implement a lastLoggedIn date field that's updated to the current date everytime a user authenticates successfully.

I thought I might be able to do that by registering an after-hook on the /auth/local service, but those hooks are never invoked:

  app.service('/auth/local').after({
    all: [
      hook => console.log(hook.result),
    ],
  });

That console.log never runs. If this is not the way to do this kind of thing, how should I go about doing it?

0

There are 0 answers