public IEnumerator Authorize() { if (_rDataClient.Authorized) { LastError = new RDataAuthorizationException("Already authorized"); yield break; } if (!_jwtAuthClient.Authenticated) { LastError = new RDataAuthorizationException(string.Format("You must call {0}.Authenticate before calling {1}.Authorize", typeof(JwtAuthenticationClient).Name, typeof(JwtAuthorizationStrategy).Name)); yield break; } yield return(CoroutineManager.StartCoroutine(SendAuthorizationRequest(_jwtAuthClient.AccessToken, _rDataClient.GameVersion, _jwtAuthClient.SelectedGroups))); if (_rDataClient.Authorized) { _rDataClient.OnAuthorized(); } }
public IEnumerator Authorize() { if (_client.Authorized) { LastError = new RDataException("Already authorized"); yield break; } if (string.IsNullOrEmpty(UserId)) { LastError = new RDataException("You must set the user id on the authorization strategy to authorize"); yield break; } yield return(CoroutineManager.StartCoroutine(SendAuthorizationRequest(UserId, _client.GameVersion))); if (_client.Authorized) { _client.OnAuthorized(); } }