Moved all login logic to login controller