@@ -99,7 +99,7 @@ public static void setCustomUserClaims(
9999 // Set admin privilege on the user corresponding to uid.
100100 Map <String , Object > claims = new HashMap <>();
101101 claims .put ("admin" , true );
102- FirebaseAuth .getInstance ().setCustomClaimsAsync (uid , claims ).get ();
102+ FirebaseAuth .getInstance ().setCustomUserClaimsAsync (uid , claims ).get ();
103103 // The new custom claims will propagate to the user's ID token the
104104 // next time a new one is issued.
105105 // [END set_custom_user_claims]
@@ -128,7 +128,7 @@ public static void setCustomUserClaimsScript() throws InterruptedException, Exec
128128 if (user .isEmailVerified ()) {
129129 Map <String , Object > claims = new HashMap <>();
130130 claims .put ("admin" , true );
131- FirebaseAuth .getInstance ().setCustomClaimsAsync (user .getUid (), claims ).get ();
131+ FirebaseAuth .getInstance ().setCustomUserClaimsAsync (user .getUid (), claims ).get ();
132132 }
133133 // [END set_custom_user_claims_script]
134134 }
@@ -143,7 +143,7 @@ public static void setCustomUserClaimsInc() throws InterruptedException, Executi
143143 // Add level.
144144 currentClaims .put ("level" , 10 );
145145 // Add custom claims for additional privileges.
146- FirebaseAuth .getInstance ().setCustomClaimsAsync (user .getUid (), currentClaims ).get ();
146+ FirebaseAuth .getInstance ().setCustomUserClaimsAsync (user .getUid (), currentClaims ).get ();
147147 }
148148 // [END set_custom_user_claims_incremental]
149149 }
0 commit comments