only initialize js app when token is present