Moves login/logout code to Auth model.