diff --git a/firestore.rules b/firestore.rules index fc2bc8187a..1a5e638406 100644 --- a/firestore.rules +++ b/firestore.rules @@ -221,6 +221,7 @@ service cloud.firestore { allow write: if false; } + // TODO: Remove along with data match /users/{userId} { allow list: if false; diff --git a/functions/src/index.ts b/functions/src/index.ts index f7c3768e90..8fa0ee2adf 100644 --- a/functions/src/index.ts +++ b/functions/src/index.ts @@ -10,7 +10,6 @@ import { mailchimpSubscribe } from './mailchimp-subscribe.js'; import { sendGeneralNotification } from './notifications.js'; import { optimizeImages } from './optimize-images.js'; import { prerender } from './prerender.js'; -import { saveUserData } from './save-user-data.js'; import { scheduleNotifications } from './schedule-notifications.js'; // TODO: Update `tsconfig.json` @@ -20,7 +19,6 @@ import { scheduleNotifications } from './schedule-notifications.js'; initializeApp(); export { - saveUserData, sendGeneralNotification, scheduleNotifications, optimizeImages, diff --git a/functions/src/save-user-data.ts b/functions/src/save-user-data.ts deleted file mode 100644 index 6c6656b060..0000000000 --- a/functions/src/save-user-data.ts +++ /dev/null @@ -1,15 +0,0 @@ -// https://github.com/import-js/eslint-plugin-import/issues/1810 -// eslint-disable-next-line import/no-unresolved -import { getFirestore } from 'firebase-admin/firestore'; -import { auth } from 'firebase-functions'; - -export const saveUserData = auth.user().onCreate((userRecord) => { - const uid = userRecord.uid || userRecord.providerData[0].uid; - const userData = { - email: userRecord.email || userRecord.providerData[0].email || '', - displayName: userRecord.displayName || userRecord.providerData[0].displayName || '', - photoURL: userRecord.photoURL || userRecord.providerData[0].photoURL || '', - }; - - return getFirestore().collection('users').doc(uid).set(userData); -});