Skip to content

Commit 3c3061c

Browse files
committed
Align comments
1 parent f46bbef commit 3c3061c

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

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

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -219,11 +219,13 @@ public static void verifyIdTokenCheckRevoked(String idToken) throws InterruptedE
219219
FirebaseToken decodedToken = FirebaseAuth.getInstance().verifyIdTokenAsync(idToken, checkRevoked).get();
220220
// Token is valid and not revoked.
221221
String uid = decodedToken.getUid();
222-
} catch (FirebaseAuthException e) {
223-
if ("id-token-revoked".equals(e.getErrorCode())) {
224-
// Token has been revoked. Inform the user to reauthenticate or signOut() the user.
225-
} else {
226-
// Token is invalid.
222+
} catch (ExecutionException e) {
223+
if (e.getCause() instanceof FirebaseAuthException) {
224+
if ( ((FirebaseAuthException) e.getCause()).getErrorCode().equals("id-token-revoked")) {
225+
// Token has been revoked. Inform the user to reauthenticate or signOut() the user.
226+
} else {
227+
// Token is invalid.
228+
}
227229
}
228230
}
229231
// [END verify_id_token_check_revoked]

0 commit comments

Comments
 (0)