Esempio n. 1
0
        internal static void SignOut(JsonHttpClient jsonHttp)
        {
            var response = jsonHttp.Put("v1/session/signout");

            if (response.IntAt("success") != 1)
            {
                throw new ClientException(ClientException.FailureReason.RespondedWithError,
                                          "Failed to sign out");
            }
        }
Esempio n. 2
0
        internal static void ReauthorizeDevice(ClientInfo clientInfo, JsonHttpClient jsonHttp)
        {
            var response = jsonHttp.Put(string.Format("v1/device/{0}/reauthorize", clientInfo.Uuid));

            if (response.IntAt("success") != 1)
            {
                throw new ClientException(ClientException.FailureReason.RespondedWithError,
                                          string.Format("Failed to reauthorize the device '{0}'",
                                                        clientInfo.Uuid));
            }
        }