Implement login/token check functionality