update do_auth to support email login