Skip to content

Commit 73df3a7

Browse files
committed
re-add csrfToken in graphql request
1 parent 294b9cc commit 73df3a7

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

app/src/main/java/org/openimis/imispolicies/network/okhttp/AuthorizationInterceptor.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ public Response intercept(@NonNull Chain chain) throws IOException {
3434
Request.Builder builder = chain.request().newBuilder();
3535
builder.addHeader("Authorization", "bearer " + token.trim());
3636
builder.addHeader("User-Agent", USER_AGENT);
37+
if(!StringUtils.isEmpty(csrfToken)){
38+
builder.addHeader("X-Csrftoken", csrfToken);
39+
}
3740
Response response = chain.proceed(builder.build());
3841
if (response.code() == HttpURLConnection.HTTP_UNAUTHORIZED) {
3942
repository.saveFhirToken(null, null, null);

0 commit comments

Comments
 (0)