Added demographic information to the user
This commit is contained in:
@@ -4,6 +4,7 @@ import {app} from "@/firebase";
|
||||
import {sessionOptions} from "@/lib/session";
|
||||
import {withIronSessionApiRoute} from "iron-session/next";
|
||||
import {getFirestore, getDoc, doc, setDoc} from "firebase/firestore";
|
||||
import {DemographicInformation} from "@/interfaces/user";
|
||||
|
||||
const auth = getAuth(app);
|
||||
const db = getFirestore(app);
|
||||
@@ -25,7 +26,7 @@ const DEFAULT_LEVELS = {
|
||||
};
|
||||
|
||||
async function login(req: NextApiRequest, res: NextApiResponse) {
|
||||
const {email, password} = req.body as {email: string; password: string};
|
||||
const {email, password} = req.body as {email: string; password: string; demographicInformation: DemographicInformation};
|
||||
|
||||
createUserWithEmailAndPassword(auth, email, password)
|
||||
.then(async (userCredentials) => {
|
||||
|
||||
Reference in New Issue
Block a user