File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed
auth/src/main/java/com/google/firebase/quickstart Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -219,11 +219,13 @@ public static void verifyIdTokenCheckRevoked(String idToken) throws InterruptedE
219
219
FirebaseToken decodedToken = FirebaseAuth .getInstance ().verifyIdTokenAsync (idToken , checkRevoked ).get ();
220
220
// Token is valid and not revoked.
221
221
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
+ }
227
229
}
228
230
}
229
231
// [END verify_id_token_check_revoked]
You can’t perform that action at this time.
0 commit comments