debug log für verbundene Piloten
This commit is contained in:
@@ -92,6 +92,11 @@ export default function AdminPanel() {
|
|||||||
|
|
||||||
const modalRef = useRef<HTMLDialogElement>(null);
|
const modalRef = useRef<HTMLDialogElement>(null);
|
||||||
|
|
||||||
|
console.debug("piloten von API", {
|
||||||
|
anzahl: pilots?.length,
|
||||||
|
pilots,
|
||||||
|
});
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<button
|
<button
|
||||||
@@ -108,11 +113,11 @@ export default function AdminPanel() {
|
|||||||
<form method="dialog">
|
<form method="dialog">
|
||||||
<button className="btn btn-sm btn-circle btn-ghost absolute right-2 top-2">✕</button>
|
<button className="btn btn-sm btn-circle btn-ghost absolute right-2 top-2">✕</button>
|
||||||
</form>
|
</form>
|
||||||
<h3 className="font-bold text-lg flex items-center gap-2">
|
<h3 className="flex items-center gap-2 text-lg font-bold">
|
||||||
<Shield size={22} /> Admin Panel
|
<Shield size={22} /> Admin Panel
|
||||||
</h3>
|
</h3>
|
||||||
<div className="flex gap-2 mt-4 w-full">
|
<div className="mt-4 flex w-full gap-2">
|
||||||
<div className="card bg-base-300 shadow-md w-full h-96 overflow-y-auto">
|
<div className="card bg-base-300 h-96 w-full overflow-y-auto shadow-md">
|
||||||
<div className="card-body">
|
<div className="card-body">
|
||||||
<div className="card-title flex items-center gap-2">
|
<div className="card-title flex items-center gap-2">
|
||||||
<UserCheck size={20} /> Verbundene Clients
|
<UserCheck size={20} /> Verbundene Clients
|
||||||
|
|||||||
@@ -18,9 +18,16 @@ export const options: AuthOptions = {
|
|||||||
try {
|
try {
|
||||||
if (!credentials) throw new Error("No credentials provided");
|
if (!credentials) throw new Error("No credentials provided");
|
||||||
const user = await prisma.user.findFirst({
|
const user = await prisma.user.findFirst({
|
||||||
where: { email: credentials.email },
|
where: {
|
||||||
|
email: {
|
||||||
|
contains: credentials.email,
|
||||||
|
mode: "insensitive",
|
||||||
|
},
|
||||||
|
},
|
||||||
});
|
});
|
||||||
const v1User = (oldUser as OldUser[]).find((u) => u.email.toLowerCase() === credentials.email.toLowerCase());
|
const v1User = (oldUser as OldUser[]).find(
|
||||||
|
(u) => u.email.toLowerCase() === credentials.email,
|
||||||
|
);
|
||||||
if (!user && v1User) {
|
if (!user && v1User) {
|
||||||
if (bcrypt.compareSync(credentials.password, v1User.password)) {
|
if (bcrypt.compareSync(credentials.password, v1User.password)) {
|
||||||
const newUser = await createNewUserFromOld(v1User);
|
const newUser = await createNewUserFromOld(v1User);
|
||||||
|
|||||||
Reference in New Issue
Block a user