Made it so, when a user registers with an eCrop e-mail, they get the role of a developer

This commit is contained in:
Tiago Ribeiro
2023-12-06 15:15:50 +00:00
parent 523149327b
commit 18f163768c

View File

@@ -65,7 +65,7 @@ async function registerIndividual(req: NextApiRequest, res: NextApiResponse) {
bio: "", bio: "",
isFirstLogin: codeData ? codeData.type === "student" : true, isFirstLogin: codeData ? codeData.type === "student" : true,
focus: "academic", focus: "academic",
type: codeData ? codeData.type : "student", type: email.endsWith("@ecrop.dev") ? "developer" : codeData ? codeData.type : "student",
subscriptionExpirationDate: codeData ? codeData.expiryDate : moment().subtract(1, "days").toISOString(), subscriptionExpirationDate: codeData ? codeData.expiryDate : moment().subtract(1, "days").toISOString(),
registrationDate: new Date(), registrationDate: new Date(),
status: code ? "active" : "paymentDue", status: code ? "active" : "paymentDue",