rbCAS/CASino — pull request #16 by dlindahl (2013-10-26 00:45:13+00:00)
Title: Is there an official way to return the current user?

I'd like to add a few additional pages to my CASino powered application that require a user to be signed in.

Most authentication systems provide a `user_signed_in?` method to determine if a user is currently signed in and/or a `current_user` that returns that user's record. These methods are also typically used in a `before_filter` to restrict access to sensitive pages.

Browsing through the source code, it does not appear that there are any controller helpers that provide this information. The closest thing I could find was in `app/controllers/casino/sessions_controller.rb` on [lines 5-6](https://github.com/rbCAS/CASino/blob/be2b12ac3ff66f5d7312155f6fb144e4088dba2d/app/controllers/casino/sessions_controller.rb#L5-L6)

```ruby
processor(:TwoFactorAuthenticatorOverview).process(cookies, request.user_agent)
processor(:SessionOverview).process(cookies, request.user_agent)
```

However, I'm not sure that these methods would work very well in a helper method if they were simply ported over.

Do you have any thoughts on how to expose this information to application controllers outside of the context of CASino itself?