caches the current token when the provider changes.