Description
Related issues
[REQUIRED] Version info
node:
node version : 10
firebase-functions:
3.12
firebase-tools:
8.16.2
firebase-admin:
9.3.0
[REQUIRED] Test case
Create custom token with claims
const claims = {test:"test"}; const uid = 123; admin.auth().createCustomToken(uid, claims);
delete user (this is dart code)
final currentUser = await FirebaseAuth.instance.currentUser(); await currentUser.delete();
trigger:
exports.deleteUserData = functions.auth.user().onDelete((userRecord, context) => { console.log(userRecord.customClaims); console.log(context.auth.token); });
[REQUIRED] Steps to reproduce
- create a custom token with claims.
- Login using the custom token.
- After login with custom token, delete user with flutter client sdk.
- Check function logs and see that customClaims is empty.
[REQUIRED] Expected behavior
context.auth.token
and
userRecord.customClaims
should not be undefined or empty, but contain the claims of the deleted user.
[REQUIRED] Actual behavior
email: null, emailVerified: false, displayName: null, photoURL: null, phoneNumber: null, disabled: false, providerData: [], customClaims: {}, passwordSalt: null, passwordHash: null, tokensValidAfterTime: null, uid: '10659670',
Were you able to successfully deploy your functions?
No error messages