old version
login and auth flow mostly working