jing: add login/saveToken functions