Skip to content

Commit

Permalink
handle auth cancel on android
Browse files Browse the repository at this point in the history
  • Loading branch information
elringus committed Sep 19, 2019
1 parent 81d155a commit c21cb31
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ private void onAuthorizationResponse (bool isError, string error, string codeVer
if (OnAuthResponse != null)
OnAuthResponse.Invoke(response);
}

private void onAuthorizationResponse (bool isError, AndroidJavaObject error, string codeVerifier, string redirectUri, string authorizationCode)
{
onAuthorizationResponse(isError, error?.ToString(), codeVerifier, redirectUri, authorizationCode);
}
}

public event Action<IAccessTokenProvider> OnDone;
Expand Down Expand Up @@ -86,7 +91,7 @@ private void HandleAccessTokenRefreshed (AccessTokenRefresher refresher)
{
var message = "UnityGoogleDrive: Failed to refresh access token; executing full auth procedure.";
if (!string.IsNullOrEmpty(refresher.Error))
message += string.Format("\nDetails: {0}", refresher.Error);
message += $"\nDetails: {refresher.Error}";
Debug.Log(message);
}
ExecuteFullAuth();
Expand Down Expand Up @@ -146,7 +151,7 @@ private void HandleAuthorizationResponseOnUnityThread (object responseObj)

if (response.IsError)
{
Debug.LogError(string.Format("UnityGoogleDrive: OAuth authorization error: {0}.", response.Error));
Debug.LogError($"UnityGoogleDrive: OAuth authorization error: {response.Error}.");
HandleProvideAccessTokenComplete(true);
return;
}
Expand Down

0 comments on commit c21cb31

Please sign in to comment.