auto-relogin: save api token in localStorage