mirror of
https://gitea.gofwd.group/dstrawsb/ballistic-builder.git
synced 2025-12-06 02:36:44 -05:00
database stuff
This commit is contained in:
@@ -4,6 +4,8 @@ import { useState } from "react";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { addUser, getUserByEmail } from "@actions/userActions";
|
||||
import { users } from '@schemas/schema';
|
||||
import bcrypt from 'bcryptjs';
|
||||
|
||||
export default function RegistrationForm() {
|
||||
const router = useRouter();
|
||||
const [error, setError] = useState("");
|
||||
@@ -33,12 +35,13 @@ export default function RegistrationForm() {
|
||||
}
|
||||
|
||||
try {
|
||||
const hashedPassword = await bcrypt.hash(formData.password, 10);
|
||||
addUser(
|
||||
formData.first_name,
|
||||
formData.last_name,
|
||||
formData.username,
|
||||
formData.email,
|
||||
formData.password
|
||||
hashedPassword
|
||||
);
|
||||
router.push("/signin"); // Redirect to login after successful registration
|
||||
} catch (err) {
|
||||
|
||||
Reference in New Issue
Block a user