Skip to content

Commit 3834676

Browse files
committed
PR fixes
1 parent 3c3061c commit 3834676

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

auth/src/main/java/com/google/firebase/quickstart/AuthSnippets.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,8 @@ public static void verifyIdTokenCheckRevoked(String idToken) throws InterruptedE
221221
String uid = decodedToken.getUid();
222222
} catch (ExecutionException e) {
223223
if (e.getCause() instanceof FirebaseAuthException) {
224-
if ( ((FirebaseAuthException) e.getCause()).getErrorCode().equals("id-token-revoked")) {
224+
FirebaseAuthException authError = (FirebaseAuthException) e.getCause();
225+
if (authError.getErrorCode().equals("id-token-revoked")) {
225226
// Token has been revoked. Inform the user to reauthenticate or signOut() the user.
226227
} else {
227228
// Token is invalid.
@@ -243,7 +244,7 @@ public static void revokeIdTokens(String idToken) throws InterruptedException, E
243244

244245
// [START save_revocation_in_db]
245246
DatabaseReference ref = FirebaseDatabase.getInstance().getReference("metadata/" + uid);
246-
ref.setValueAsync(ImmutableMap.<String, Object>of("revokeTime", revocationSecond)).get();
247+
ref.setValueAsync(new HashMap<String, Object>().put("revokeTime", revocationSecond)).get();
247248
// [END save_revocation_in_db]
248249

249250
}

0 commit comments

Comments
 (0)