Skip to content

Commit 78a3a49

Browse files
authored
dep(android): update net.openid:appauth from 0.8.1 to 0.11.1 (#731)
* dep(android): update net.openid:appauth from 0.8.1 to 0.11.1 * dep(android): bump androidx.browser from 1.2.0 to 1.4.0 * fix: use new builder & new properties after appauth update * fix: add a null check as postLogoutRedirectUri can be null
1 parent c0481d6 commit 78a3a49

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

android/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,6 @@ repositories {
5656
dependencies {
5757
//noinspection GradleDynamicVersion
5858
implementation 'com.facebook.react:react-native:+' // From node_modules
59-
implementation 'net.openid:appauth:0.8.1'
60-
implementation 'androidx.browser:browser:1.2.0'
59+
implementation 'net.openid:appauth:0.11.1'
60+
implementation 'androidx.browser:browser:1.4.0'
6161
}

android/src/main/java/com/rnappauth/RNAppAuthModule.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -784,11 +784,9 @@ private void endSessionWithConfiguration(
784784
final Activity currentActivity = getCurrentActivity();
785785

786786
EndSessionRequest.Builder endSessionRequestBuilder =
787-
new EndSessionRequest.Builder(
788-
serviceConfiguration,
789-
idTokenHint,
790-
Uri.parse(postLogoutRedirectUri)
791-
);
787+
new EndSessionRequest.Builder(serviceConfiguration)
788+
.setIdTokenHint(idTokenHint)
789+
.setPostLogoutRedirectUri(Uri.parse(postLogoutRedirectUri));
792790

793791
if (additionalParametersMap != null) {
794792
if (additionalParametersMap.containsKey("state")) {

android/src/main/java/com/rnappauth/utils/EndSessionResponseFactory.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,10 @@ public static final WritableMap endSessionResponseToMap(EndSessionResponse respo
1313
WritableMap map = Arguments.createMap();
1414

1515
map.putString("state", response.state);
16-
map.putString("idTokenHint", response.request.idToken);
17-
map.putString("postLogoutRedirectUri", response.request.redirectUri.toString());
16+
map.putString("idTokenHint", response.request.idTokenHint);
17+
if (response.request.postLogoutRedirectUri != null) {
18+
map.putString("postLogoutRedirectUri", response.request.postLogoutRedirectUri.toString());
19+
}
1820

1921
return map;
2022
}

0 commit comments

Comments
 (0)