finally got the login flow working