Created
May 9, 2018 06:28
-
-
Save DrDanL/02e68f87eba87fd5bbbed62bbcf59dca to your computer and use it in GitHub Desktop.
Firebase onDelete - see https://leightley.com/firebase-functions-oncreate-ondelete/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const functions = require('firebase-functions'); | |
const admin = require('firebase-admin'); | |
admin.initializeApp(functions.config().firebase); | |
exports.deleteProfile = functions.auth.user().onDelete( event => { | |
return admin.database().ref(`/user/${event.data.uid}`).remove(); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment