This commit is contained in:
Ismail Ali
2025-06-26 22:56:20 +02:00
parent 137839da98
commit b9651a53a9
82 changed files with 7476 additions and 4171 deletions

View File

@@ -2,14 +2,15 @@
import bcrypt from "bcryptjs";
import { generateToken } from "../utils/cryptoUtils";
import USERS from "../config/users";
import { setAdminLoggedIn } from "../../../../redux/slices/authSlice"; // ✅ Wichtig
import { setAdminLoggedIn } from "@/redux/slices/authSlice"; // ✅ Wichtig
import { AppDispatch } from "@/redux/store"; // Import your AppDispatch type
const handleAdminLogin = (
username: string,
password: string,
onSuccess: () => void,
onError: (errorMsg: string) => void,
dispatch: any // ✅ neu
onError: (message: string) => void,
dispatch: AppDispatch // Use the correct dispatch type
) => {
const user = USERS.Admin;
bcrypt.compare(password, user.password, (err, isMatch) => {