Moved login detection to the top of the login controller.
Small code style fix.