refactored login for new 2.6 way