Add forms and validation for domains (#27)

This commit is contained in:
KM Koushik
2024-06-07 21:55:30 +10:00
committed by GitHub
parent 544b5c1a49
commit 6128f26a78
3 changed files with 138 additions and 51 deletions

View File

@@ -7,6 +7,12 @@ import { db } from "~/server/db";
const dnsResolveTxt = util.promisify(dns.resolveTxt);
export async function createDomain(teamId: number, name: string) {
const domainStr = tldts.getDomain(name);
if (!domainStr) {
throw new Error("Invalid domain");
}
const subdomain = tldts.getSubdomain(name);
const publicKey = await ses.addDomain(name);