refactor to use flags for argument parsing for login and logout
fix login error
merge conflicts