public static void getAuthDetails(JDISClient requester) { if (File.Exists(Path.Combine(Application.dataPath, "auth.token"))) { string value = File.ReadAllText(Path.Combine(Application.dataPath, "auth.token")); JDISKey authKey = JsonConvert.DeserializeObject <JDISKey>(value); requester.authKey = authKey; requester.Initialize(); } else { requester.WebService.Request <JDISAuthRequest, JDISAuthResponse>(new JDISAuthRequest(), delegate(JDISResponse <JDISAuthResponse> res) { requester.authKey = res.getData().key(); requester.authKey.storeKey(); requester.Initialize(); }); } }
public void Authenticate(JDISClient sender) { this.AUTH = sender.authKey; }