Skip to content
This repository has been archived by the owner on Apr 19, 2023. It is now read-only.

Commit

Permalink
✨ Add new user registrations check
Browse files Browse the repository at this point in the history
  • Loading branch information
AnandChowdhary committed Sep 24, 2020
1 parent 43adebc commit b248d84
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/_staart/rest/auth.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { config } from "@anandchowdhary/cosmic";
import {
backupCodes,
MembershipRole,
Expand Down Expand Up @@ -142,6 +143,8 @@ export const register = async (
role?: MembershipRole,
emailVerified = false
) => {
if (!config("newUserRegistrations"))
throw new Error("User registrations are not enabled");
if (email) {
const isNewEmail =
(await prisma.emails.findMany({ where: { email, isVerified: true } }))
Expand Down

0 comments on commit b248d84

Please sign in to comment.