NoamB/sorcery — Issue #209: logging successful and failed login attempts
Author: bmurzeau
Created: 2012-02-13 07:42:33+00:00
State: open

Hi,

I would like to log every successful login and also failed attempts. I did not find a way to do that in the documentation, however by looking at the source code it seems that `after_login!` and `after_failed_login!` should be the right place to be (I don't want to do that inside the controller).

In the initializer file I added:
```ruby
config.after_login << :my_login_method
config.after_failed_login << :my_login_error_method
```
This works great but the methods definition are at the end of the initializer and this does look good at all. I would like to move these definitions inside a new module / class located in `./lib` so the initializer file looks like:

```ruby
config.after_login << MyModule::Log.my_login_method
config.after_failed_login << MyModule::Log.my_login_error_method
```
I could not work out the right syntax to get this working so any help would be much appreciated. Also if there is another way to achieve that please let me know. I'll try to post a more complete example of my issue.

Thanks a lot for Sorcery, it's an awesome gem!