Skip to content

Commit 2345159

Browse files
committed
revert changes to the unlink method call
1 parent 650b99e commit 2345159

2 files changed

Lines changed: 4 additions & 6 deletions

File tree

lib/src/main/java/com/auth0/authentication/AuthenticationAPIClient.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ public class AuthenticationAPIClient {
5959
private static final String REFRESH_TOKEN_KEY = "refresh_token";
6060
private static final String PHONE_NUMBER_KEY = "phone_number";
6161
private static final String USER_ID_KEY = "user_id";
62+
private static final String CLIENT_ID_KEY = "clientID";
6263
private static final String DELEGATION_PATH = "delegation";
6364
private static final String ACCESS_TOKEN_PATH = "access_token";
6465
private static final String SIGN_UP_PATH = "signup";
@@ -376,15 +377,14 @@ public DelegationRequest<Map<String, Object>> delegationWithRefreshToken(String
376377
* @return a request to start
377378
*/
378379
public Request<Void> unlink(String userId, String accessToken) {
379-
//TODO: Test this after removing .set("clientID", getClientId())
380380
HttpUrl url = HttpUrl.parse(auth0.getDomainUrl()).newBuilder()
381381
.addPathSegment(UNLINK_PATH)
382382
.build();
383383

384384
ParameterizableRequest<Void> request = factory.POST(url, client, mapper);
385385
request.getParameterBuilder()
386-
.setClientId(getClientId())
387386
.setAccessToken(accessToken)
387+
.set(CLIENT_ID_KEY, getClientId())
388388
.set(USER_ID_KEY, userId);
389389
return request;
390390
}

lib/src/test/java/com/auth0/authentication/AuthenticationAPIClientTest.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -829,8 +829,7 @@ public void shouldUnlinkAccount() throws Exception {
829829
assertThat(request.getPath(), equalTo("/unlink"));
830830

831831
Map<String, String> body = bodyFromRequest(request);
832-
// assertThat(body, hasEntry("clientID", CLIENT_ID));
833-
assertThat(body, hasEntry("client_id", CLIENT_ID));
832+
assertThat(body, hasEntry("clientID", CLIENT_ID));
834833
assertThat(body, hasEntry("user_id", "user id"));
835834
assertThat(body, hasEntry("access_token", "access token"));
836835

@@ -848,8 +847,7 @@ public void shouldUnlinkAccountSync() throws Exception {
848847
assertThat(request.getPath(), equalTo("/unlink"));
849848

850849
Map<String, String> body = bodyFromRequest(request);
851-
// assertThat(body, hasEntry("clientID", CLIENT_ID));
852-
assertThat(body, hasEntry("client_id", CLIENT_ID));
850+
assertThat(body, hasEntry("clientID", CLIENT_ID));
853851
assertThat(body, hasEntry("user_id", "user id"));
854852
assertThat(body, hasEntry("access_token", "access token"));
855853
}

0 commit comments

Comments
 (0)