Skip to content

Commit

Permalink
removed unnecessary creation of user object in Firestore from emailPa…
Browse files Browse the repository at this point in the history
…sswordAuthentication.ts
  • Loading branch information
nkanchinadam committed Sep 16, 2024
1 parent 37302b9 commit 1f90e75
Showing 1 changed file with 0 additions and 29 deletions.
29 changes: 0 additions & 29 deletions src/lib/firebase/authentication/emailPasswordAuthentication.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,35 +32,6 @@ export const signUpUser = async (
throw new Error("Failed to sign up user: UID is null or undefined.");
}

// Create the user document in Firestore with default values
const userDoc = {
isAdmin: false,
firstName: "", // Default values, update later
middleName: "", // Default values, update later
lastName: "", // Default values, update later
email: user.email,
phone: 0, // Default values, update later
gender: "", // Default values, update later
birthdate: null, // Default values, update later
guardian: [], // Default values, update later
id: userUid,
address: {
street: "",
city: "",
state: "",
zip: 0,
country: "",
},
school: "",
gradYear: 0,
yearsWithSwaliga: 0,
swaligaID: 0,
ethnicity: [],
assignedSurveys: [],
completedResponses: [],
};

await setDoc(doc(db, 'users', userUid), userDoc);
await fetch("/api/auth/claims/registering", {
method: "POST",
headers: {
Expand Down

0 comments on commit 1f90e75

Please sign in to comment.