Refactoring: Guard clause to reduce nesting

I don't fully understand why these checks exist
(shouldn't it be handled by the routing?)
Refactoring: Simplify login method
Add a before_filter and extracted out some
private methods in order to simplify this complex method.