Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- exports.blockUser = functions.https.onCall(async(data, context) => {
- const user = await admin.auth().getUserByEmail(data['email']);
- if(context.auth.token.admin){
- admin.auth().setCustomUserClaims(user.uid, {
- block: true
- });
- console.log(data['email'] + " has been blocked");
- return 1;
- }else{
- return 2;
- }});
- allow read: if request.auth.token.block == null;
- allow read: if request.auth.token.block == true;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement