Skip to content

Commit

Permalink
migrate secure log calls to a method
Browse files Browse the repository at this point in the history
  • Loading branch information
lbalmaceda committed Nov 30, 2016
1 parent a08687a commit 271961d
Showing 1 changed file with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -380,9 +380,7 @@ private boolean authorize(@NonNull AuthorizeResult data) {
Log.w(TAG, "The response didn't contain any of these values: code, state, id_token, access_token, token_type, refresh_token");
return false;
}
if (loggingEnabled) {
Log.d(TAG, "The parsed CallbackURI contains the following values: " + values);
}
logDebug("The parsed CallbackURI contains the following values: " + values);

if (values.containsKey(KEY_ERROR)) {
Log.e(TAG, "Error, access denied. Check that the required Permissions are granted and that the Application has this Connection configured in Auth0 Dashboard.");
Expand Down Expand Up @@ -522,9 +520,7 @@ Uri buildAuthorizeUri() {
builder.appendQueryParameter(entry.getKey(), entry.getValue());
}
Uri uri = builder.build();
if (loggingEnabled) {
Log.d(TAG, "Using the following AuthorizeURI: " + uri.toString());
}
logDebug("The parsed CallbackURI contains the following values: " + "Using the following AuthorizeURI: " + uri.toString());
return uri;
}

Expand Down Expand Up @@ -574,4 +570,10 @@ private String secureRandomString() {
sr.nextBytes(randomBytes);
return Base64.encodeToString(randomBytes, Base64.URL_SAFE | Base64.NO_WRAP | Base64.NO_PADDING);
}

private void logDebug(String message) {
if (loggingEnabled) {
Log.d(TAG, message);
}
}
}

0 comments on commit 271961d

Please sign in to comment.