-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstartup.js
More file actions
48 lines (45 loc) · 1.28 KB
/
startup.js
File metadata and controls
48 lines (45 loc) · 1.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
import { PrismaClient } from "@prisma/client";
import { hash } from "bcrypt";
const prisma = new PrismaClient();
async function startup() {
const data = await hash("passwordHere", 10);
const user = await prisma.user.create({
data: {
userName: "stephen",
name: "Stephen Gruzin",
email: "me@stephengruzin.dev",
phone: "",
password: data,
tfa: "0",
successLogins: 0,
failedLogins: 0,
popularSites: "",
currentChallenge: "",
tokenVersion: 0,
}
});
if (!user) {
console.log("No user created.");
}
await prisma.registeredSite.create({
data: {
logins: 0,
url: "https://testauth.stephengruzin.dev/myAuth",
name: "GruzAuth",
unique: "gruzauth",
owner: user.id,
themes: JSON.stringify(["system", "light", "dark"])
}
});
await prisma.registeredSite.create({
data: {
logins: 0,
url: "http://192.168.0.24:5173/myAuth",
name: "GruzAuth Beta",
unique: "gruzauth2",
owner: user.id,
themes: JSON.stringify(["system", "light", "dark"])
}
});
}
startup();