1. Home
  2. Docs
  3. UniREST Solution 3.5
  4. UniREST Client
  5. Token Manager
  6. Token Integration

Token Integration

The Update*() methods change the Tokens in the database users table and then integrate the new Tokens into the UniRESTClient class. However, if you set the integrateToken property to false, this won’t happen and the Update*() methods will just update the table and release the new Token, without updating the UniRESTClient class.

This will allow you to have more control over the Token system, but then you will have to integrate the Tokens manually, into the UniRESTClient class.


#UniRESTClient#.#Async#.#TokenManager#.$IntegrateLogin$(%token%);

#UniRESTClient#.#Async#.#TokenManager#.$IntegrateRead$(%token%);

#UniRESTClient#.#Async#.#TokenManager#.$IntegrateWrite$(%token%);

token|string
The new Token (received by the Update*() method) to integrate into the UniRESTClient class.

_ = UniRESTClient.Async.TokenManager.UpdateLogin(
    (bool ok, string token) => 
    {
          if (ok)
          {
              Debug.Log("This login Token is valid!");

              // Manual Token integration.
              UniRESTClient.Async.TokenManager.IntegrateLogin(token);

          } else {
              Debug.LogError("Error!");
          }
    }, false // <- This blocks the automatic Token integration.
    );