Esempio n. 1
0
 /// <summary>
 /// Initializes a new instance of the Trello API handler
 /// </summary>
 private void initAPIHandler()
 {
     if (Trello.IsValidToken(config.Token))
     {
         trello = new Trello(config.Token);
     }
     else
     {
         EditorUtility.DisplayDialog("Invalid Token", "Invalid Trello API credentials. Please re-enter your token.", "OK");
         // remove bad token to force reauth
         logOut();
     }
 }
Esempio n. 2
0
        /// <summary>
        /// Checks if the current token is valid, shows a message if invalid
        /// </summary>
        /// <returns></returns>
        private bool tokenIsValid(string token)
        {
            bool valid = Trello.IsValidToken(token);

            if (!valid)
            {
                // show message
                EditorUtility.DisplayDialog("Invalid Token", "The provided token is invalid. Please enter a valid Trello API token.", "OK");

                // highlight token field
                EditorGUI.FocusTextInControl("Token");
            }
            return(valid);
        }