flipped implementation of login