changed to Daphnis
This commit is contained in:
@ -4,7 +4,7 @@ import { cookies } from "next/headers";
|
||||
import { redirect } from "next/navigation";
|
||||
import { Argon2id } from "oslo/password";
|
||||
import { lucia } from "@/lib/lucia";
|
||||
import { lachesis } from "@/lib/prisma";
|
||||
import { daphnis } from "@/lib/prisma";
|
||||
|
||||
const signIn = async (formData: FormData) => {
|
||||
const formDataRaw = {
|
||||
@ -13,7 +13,7 @@ const signIn = async (formData: FormData) => {
|
||||
};
|
||||
|
||||
try {
|
||||
const user = await lachesis.user.findUnique({
|
||||
const user = await daphnis.user.findUnique({
|
||||
where: { username: formDataRaw.username },
|
||||
});
|
||||
|
||||
|
@ -5,7 +5,7 @@ import { cookies } from "next/headers";
|
||||
import { redirect } from "next/navigation";
|
||||
import { Argon2id } from "oslo/password";
|
||||
import { lucia } from "@/lib/lucia";
|
||||
import { lachesis, artemis } from "@/lib/prisma";
|
||||
import { daphnis, artemis } from "@/lib/prisma";
|
||||
|
||||
const signUp = async (formData: FormData) => {
|
||||
const formDataRaw = {
|
||||
@ -21,8 +21,8 @@ const signUp = async (formData: FormData) => {
|
||||
}
|
||||
|
||||
try {
|
||||
// Check if access code is already used in lachesis database
|
||||
const existingUser = await lachesis.user.findFirst({
|
||||
// Check if access code is already used in daphnis database
|
||||
const existingUser = await daphnis.user.findFirst({
|
||||
where: {
|
||||
accessCode: formDataRaw.accessCode,
|
||||
},
|
||||
@ -32,8 +32,8 @@ const signUp = async (formData: FormData) => {
|
||||
return { error: "Access Code already in use" };
|
||||
}
|
||||
|
||||
// Check if username is already used in lachesis database
|
||||
const existingUsername = await lachesis.user.findFirst({
|
||||
// Check if username is already used in daphnis database
|
||||
const existingUsername = await daphnis.user.findFirst({
|
||||
where: {
|
||||
username: formDataRaw.username,
|
||||
},
|
||||
@ -43,7 +43,7 @@ const signUp = async (formData: FormData) => {
|
||||
return { error: "Username is currently taken" };
|
||||
}
|
||||
|
||||
const existingEmail = await lachesis.user.findFirst({
|
||||
const existingEmail = await daphnis.user.findFirst({
|
||||
where: {
|
||||
email: formDataRaw.email,
|
||||
},
|
||||
@ -67,8 +67,8 @@ const signUp = async (formData: FormData) => {
|
||||
const hashedPassword = await new Argon2id().hash(formDataRaw.password);
|
||||
const userId = generateId(15);
|
||||
|
||||
// Create user in the lachesis database
|
||||
await lachesis.user.create({
|
||||
// Create user in the daphnis database
|
||||
await daphnis.user.create({
|
||||
data: {
|
||||
id: userId,
|
||||
username: formDataRaw.username,
|
||||
|
Reference in New Issue
Block a user