Fix build errors

This commit is contained in:
Fergal Moran
2024-09-09 19:12:18 +01:00
parent fb30866000
commit b07295ad0d
11 changed files with 8909 additions and 309 deletions

View File

@@ -11,6 +11,7 @@ const config = {
"plugin:@typescript-eslint/stylistic-type-checked",
],
rules: {
"@typescript-eslint/no-empty-object-type": "off",
"@typescript-eslint/prefer-nullish-coalescing": "off",
"@typescript-eslint/array-type": "off",
"@typescript-eslint/consistent-type-definitions": "off",

View File

@@ -1,4 +1,4 @@
{
// "workbench.colorTheme": "Tinacious Design (High Contrast)"
"workbench.colorTheme": "Cyberpunk 2077 rebuild",
"workbench.colorTheme": "Moonlight",
}

8519
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 53 KiB

View File

@@ -0,0 +1,59 @@
import * as React from "react"
import { cva, type VariantProps } from "class-variance-authority"
import { cn } from "@/lib/utils"
const alertVariants = cva(
"relative w-full rounded-lg border px-4 py-3 text-sm [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground [&>svg~*]:pl-7",
{
variants: {
variant: {
default: "bg-background text-foreground",
destructive:
"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive",
},
},
defaultVariants: {
variant: "default",
},
}
)
const Alert = React.forwardRef<
HTMLDivElement,
React.HTMLAttributes<HTMLDivElement> & VariantProps<typeof alertVariants>
>(({ className, variant, ...props }, ref) => (
<div
ref={ref}
role="alert"
className={cn(alertVariants({ variant }), className)}
{...props}
/>
))
Alert.displayName = "Alert"
const AlertTitle = React.forwardRef<
HTMLParagraphElement,
React.HTMLAttributes<HTMLHeadingElement>
>(({ className, ...props }, ref) => (
<h5
ref={ref}
className={cn("mb-1 font-medium leading-none tracking-tight", className)}
{...props}
/>
))
AlertTitle.displayName = "AlertTitle"
const AlertDescription = React.forwardRef<
HTMLParagraphElement,
React.HTMLAttributes<HTMLParagraphElement>
>(({ className, ...props }, ref) => (
<div
ref={ref}
className={cn("text-sm [&_p]:leading-relaxed", className)}
{...props}
/>
))
AlertDescription.displayName = "AlertDescription"
export { Alert, AlertTitle, AlertDescription }

View File

@@ -0,0 +1,25 @@
import * as React from "react"
import { cn } from "@/lib/utils"
export interface InputProps
extends React.InputHTMLAttributes<HTMLInputElement> {}
const Input = React.forwardRef<HTMLInputElement, InputProps>(
({ className, type, ...props }, ref) => {
return (
<input
type={type}
className={cn(
"flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",
className
)}
ref={ref}
{...props}
/>
)
}
)
Input.displayName = "Input"
export { Input }

View File

@@ -1,99 +1,99 @@
'use client';
import React from 'react';
import Image from 'next/image';
import { TbThumbUp, TbThumbDown } from 'react-icons/tb';
import Link from 'next/link';
"use client";
import React from "react";
import Image from "next/image";
import { TbThumbUp, TbThumbDown } from "react-icons/tb";
import Link from "next/link";
interface IGifContainerProps {
gif: Gif;
isLink?: boolean;
showDetails?: boolean;
}
const GifContainer: React.FC<IGifContainerProps> = ({
gif,
isLink = true,
showDetails = true,
}) => {
const [upVotes, setUpVotes] = React.useState<number>(gif.upVotes);
const [downVotes, setDownVotes] = React.useState<number>(gif.downVotes);
// interface IGifContainerProps {
// gif: Gif;
// isLink?: boolean;
// showDetails?: boolean;
// }
// const GifContainer: React.FC<IGifContainerProps> = ({
// gif,
// isLink = true,
// showDetails = true,
// }) => {
// const [upVotes, setUpVotes] = React.useState<number>(gif.upVotes);
// const [downVotes, setDownVotes] = React.useState<number>(gif.downVotes);
const _doot = async (id: string, isUp: boolean) => {
const response = await fetch(`api/votes?gifId=${id}&isUp=${isUp ? 1 : 0}`, {
method: 'POST',
});
if (response.status === 200) {
const result = (await response.json()) as Gif;
setUpVotes(result.upVotes);
setDownVotes(result.downVotes);
}
};
return (
<>
<div className="group relative h-[17.5rem] transform overflow-hidden rounded-4xl">
<div className="absolute inset-0">
{isLink ? (
<Link
href={`gifs/${gif.slug}`}
title={gif.title}
>
<Image
alt={gif.title}
className="absolute inset-0 transition duration-300 group-hover:scale-110"
src={gif.fileName}
fill
sizes="100vw"
style={{
objectFit: 'fill',
}}
/>
</Link>
) : (
<Image
alt={gif.title}
className="absolute inset-0 transition duration-300 group-hover:scale-110"
src={gif.fileName}
fill
sizes="100vw"
style={{
objectFit: 'fill',
}}
/>
)}
</div>
</div>
{showDetails && (
<div className="flex flex-row p-2">
<div className="flex-1 space-x-2 text-base">
{gif.searchTerms?.map((t) => (
<div
key={t}
className="mr-0.5 badge badge-info badge-md badge-outline"
>
{`#${t}`}
</div>
))}
</div>
<div className="flex items-center justify-center space-x-1">
<div className="flex transition duration-75 ease-in-out delay-150 hover:text-orange-700 hover:cursor-pointer">
<span onClick={() => _doot(gif.id, true)}>
<TbThumbUp className="w-5" />
</span>
<span className="text-xs">{upVotes}</span>
</div>
<div className="flex transition duration-75 ease-in-out delay-150 hover:text-orange-700 hover:cursor-pointer">
<span
onClick={() => _doot(gif.id, false)}
className="pl-2 "
>
<TbThumbDown className="w-5" />
</span>
<span className="text-xs">{downVotes}</span>
</div>
</div>
</div>
)}
</>
);
};
// const _doot = async (id: string, isUp: boolean) => {
// const response = await fetch(`api/votes?gifId=${id}&isUp=${isUp ? 1 : 0}`, {
// method: 'POST',
// });
// if (response.status === 200) {
// const result = (await response.json()) as Gif;
// setUpVotes(result.upVotes);
// setDownVotes(result.downVotes);
// }
// };
// return (
// <>
// <div className="group relative h-[17.5rem] transform overflow-hidden rounded-4xl">
// <div className="absolute inset-0">
// {isLink ? (
// <Link
// href={`gifs/${gif.slug}`}
// title={gif.title}
// >
// <Image
// alt={gif.title}
// className="absolute inset-0 transition duration-300 group-hover:scale-110"
// src={gif.fileName}
// fill
// sizes="100vw"
// style={{
// objectFit: 'fill',
// }}
// />
// </Link>
// ) : (
// <Image
// alt={gif.title}
// className="absolute inset-0 transition duration-300 group-hover:scale-110"
// src={gif.fileName}
// fill
// sizes="100vw"
// style={{
// objectFit: 'fill',
// }}
// />
// )}
// </div>
// </div>
// {showDetails && (
// <div className="flex flex-row p-2">
// <div className="flex-1 space-x-2 text-base">
// {gif.searchTerms?.map((t) => (
// <div
// key={t}
// className="mr-0.5 badge badge-info badge-md badge-outline"
// >
// {`#${t}`}
// </div>
// ))}
// </div>
// <div className="flex items-center justify-center space-x-1">
// <div className="flex transition duration-75 ease-in-out delay-150 hover:text-orange-700 hover:cursor-pointer">
// <span onClick={() => _doot(gif.id, true)}>
// <TbThumbUp className="w-5" />
// </span>
// <span className="text-xs">{upVotes}</span>
// </div>
// <div className="flex transition duration-75 ease-in-out delay-150 hover:text-orange-700 hover:cursor-pointer">
// <span
// onClick={() => _doot(gif.id, false)}
// className="pl-2 "
// >
// <TbThumbDown className="w-5" />
// </span>
// <span className="text-xs">{downVotes}</span>
// </div>
// </div>
// </div>
// )}
// </>
// );
// };
export default GifContainer;
// export default GifContainer;

View File

@@ -1,64 +1,61 @@
/* eslint-disable @next/next/no-img-element */
import React from 'react';
import { HiOutlineXMark } from 'react-icons/hi2';
import { ImUpload2 } from 'react-icons/im';
interface IImageUploadProps {
value: string | undefined;
onChange: (image: File) => void;
}
const ImageUpload: React.FC<IImageUploadProps> = ({ onChange }) => {
const [image, setImage] = React.useState<string>();
const onImageChange = ($event: React.ChangeEvent<HTMLInputElement>) => {
console.log('ImageUpload', 'onImageChange', $event);
if ($event.target.files) {
const url = URL.createObjectURL($event.target.files[0]);
setImage(url);
onChange($event.target.files[0]);
}
};
return (
<div className="flex justify-center px-6 pt-5 pb-6 mt-1 border-2 border-dashed rounded-md border-secondary">
{image ? (
<div>
<div className="relative">
<img
src={image}
alt="Preview"
/>
<button
type="button"
className="absolute top-0 right-0 p-2 m-2 rounded-full "
onClick={() => setImage('')}
>
{''}
<HiOutlineXMark className="w-5 h-5" />
</button>
</div>
</div>
) : (
<div className="space-y-1 text-center">
<ImUpload2 className="w-8 h-8 mx-auto mb-3 text-base-content/70" />
<div className="flex text-sm text-base-content">
<label
htmlFor="gif-upload"
className="relative font-medium rounded-md cursor-pointer hover:text-accent badge badge-primary"
>
<span>Upload a file</span>
<input
accept="image/gif,video/mp4,video/mov,video/quicktime,video/webm,youtube,vimeo"
id="gif-upload"
type="file"
className="sr-only"
onChange={onImageChange}
/>
</label>
<p className="pl-1">or drag and drop</p>
</div>
<p className="text-xs ">PNG, JPG, GIF up to 10MB</p>
</div>
)}
</div>
);
};
// /* eslint-disable @next/next/no-img-element */
// import React from "react";
// import { HiOutlineXMark } from "react-icons/hi2";
// import { ImUpload2 } from "react-icons/im";
// interface IImageUploadProps {
// value: string | undefined;
// onChange: (image: File) => void;
// }
// const ImageUpload: React.FC<IImageUploadProps> = ({ onChange }) => {
// const [image, setImage] = React.useState<string>();
// const onImageChange = ($event: React.ChangeEvent<HTMLInputElement>) => {
// console.log("ImageUpload", "onImageChange", $event);
// if ($event.target.files) {
// const url = URL.createObjectURL($event.target.files[0]);
// setImage(url);
// onChange($event.target.files[0]);
// }
// };
// return (
// <div className="mt-1 flex justify-center rounded-md border-2 border-dashed border-secondary px-6 pb-6 pt-5">
// {image ? (
// <div>
// <div className="relative">
// <img src={image} alt="Preview" />
// <button
// type="button"
// className="absolute right-0 top-0 m-2 rounded-full p-2"
// onClick={() => setImage("")}
// >
// {""}
// <HiOutlineXMark className="h-5 w-5" />
// </button>
// </div>
// </div>
// ) : (
// <div className="space-y-1 text-center">
// <ImUpload2 className="text-base-content/70 mx-auto mb-3 h-8 w-8" />
// <div className="text-base-content flex text-sm">
// <label
// htmlFor="gif-upload"
// className="badge badge-primary relative cursor-pointer rounded-md font-medium hover:text-accent"
// >
// <span>Upload a file</span>
// <input
// accept="image/gif,video/mp4,video/mov,video/quicktime,video/webm,youtube,vimeo"
// id="gif-upload"
// type="file"
// className="sr-only"
// onChange={onImageChange}
// />
// </label>
// <p className="pl-1">or drag and drop</p>
// </div>
// <p className="text-xs">PNG, JPG, GIF up to 10MB</p>
// </div>
// )}
// </div>
// );
// };
export default ImageUpload;
// export default ImageUpload;

View File

@@ -1,143 +1,143 @@
import { logger } from "@/lib/logger";
import React, { KeyboardEventHandler } from "react";
// import { logger } from "@/lib/logger";
// import React, { KeyboardEventHandler } from "react";
interface ITaggedInputProps {
label: string;
value: string[];
onChange: (tags: string[]) => void;
}
const TaggedInput: React.FC<ITaggedInputProps> = ({
label,
value,
onChange,
}) => {
const [isSearching, setIsSearching] = React.useState(false);
const [searchText, setSearchText] = React.useState<string>("");
const [searchResults, setSearchResults] = React.useState<Array<string>>([]);
const [tags, setTags] = React.useState<Array<string>>(value);
// interface ITaggedInputProps {
// label: string;
// value: string[];
// onChange: (tags: string[]) => void;
// }
// const TaggedInput: React.FC<ITaggedInputProps> = ({
// label,
// value,
// onChange,
// }) => {
// const [isSearching, setIsSearching] = React.useState(false);
// const [searchText, setSearchText] = React.useState<string>("");
// const [searchResults, setSearchResults] = React.useState<Array<string>>([]);
// const [tags, setTags] = React.useState<Array<string>>(value);
React.useEffect(() => {
logger.debug("TaggedInput", "callingOnChange", tags);
onChange(tags);
}, [tags, onChange]);
const removeTag = (tag: string) => {
setTags(tags.filter((obj) => obj !== tag));
};
const searchTags = async (query: string) => {
if (!query) {
setSearchResults([]);
return;
}
setIsSearching(true);
const response = await fetch(`api/tags/search?q=${searchText}`);
if (response.status === 200) {
const results = await response.json();
setSearchResults(results.map((r: { name: string }) => r.name));
}
setIsSearching(false);
};
const handleChange = async ($event: React.ChangeEvent<HTMLInputElement>) => {
const { value } = $event.target;
setSearchText(value);
await searchTags(value);
};
const handleKeyPress = ($event: React.KeyboardEvent<HTMLInputElement>) => {
if ($event.code === "Enter" || $event.code === "NumpadEnter") {
__addTag(searchText);
}
};
const __addTag = (tag: string) => {
setTags([...tags, tag]);
setSearchResults([]);
setIsSearching(false);
setSearchText("");
};
const doResultClick = ($event: any) =>
__addTag($event.target.textContent as string);
return (
<>
<label htmlFor="{name}" className="block text-sm font-medium">
{label}
</label>
<div className="border-accent flex w-full rounded-lg border align-middle text-sm shadow-sm">
<div className="flex flex-row space-x-1 pl-2 pt-3">
{tags &&
tags.map((tag) => (
<span key={tag} className="badge badge-primary badge-lg py-0.5">
{tag}
<button
onClick={() => removeTag(tag)}
type="button"
className="ml-0.5 inline-flex h-4 w-4 flex-shrink-0 items-center justify-center rounded-full"
>
<span className="sr-only">{tag}</span>
<svg
className="h-2 w-2"
stroke="currentColor"
fill="none"
viewBox="0 0 8 8"
>
<path
strokeLinecap="round"
strokeWidth={1.5}
d="M1 1l6 6m0-6L1 7"
/>
</svg>
</button>
</span>
))}
</div>
<input
value={searchText}
onKeyDown={handleKeyPress}
onChange={handleChange}
placeholder="Start typing and press enter"
className="input w-full focus:outline-none"
/>
</div>
{isSearching && (
<div role="status" className="z-50 -mt-3 ml-5">
<svg
aria-hidden="true"
className="mr-2 h-4 w-4"
viewBox="0 0 100 101"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z"
fill="currentColor"
/>
<path
d="M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z"
fill="currentFill"
/>
</svg>
<span className="sr-only">Loading...</span>
</div>
)}
{searchResults && searchResults.length !== 0 && (
<div className={`z-50 mb-4 flex space-y-0`}>
<aside
aria-labelledby="menu-heading"
className="absolute z-50 -mt-5 flex w-64 flex-col items-start rounded-md border bg-white text-sm shadow-md"
>
<ul className="flex w-full flex-col">
{searchResults.map((result) => (
<li
key={result}
onClick={doResultClick}
className="cursor-pointer space-x-2 px-2 py-1 hover:bg-indigo-500 hover:text-white focus:bg-indigo-500 focus:text-white focus:outline-none"
>
{result}
</li>
))}
</ul>
</aside>
</div>
)}
</>
);
};
// React.useEffect(() => {
// logger.debug("TaggedInput", "callingOnChange", tags);
// onChange(tags);
// }, [tags, onChange]);
// const removeTag = (tag: string) => {
// setTags(tags.filter((obj) => obj !== tag));
// };
// const searchTags = async (query: string) => {
// if (!query) {
// setSearchResults([]);
// return;
// }
// setIsSearching(true);
// const response = await fetch(`api/tags/search?q=${searchText}`);
// if (response.status === 200) {
// const results = await response.json();
// setSearchResults(results.map((r: { name: string }) => r.name));
// }
// setIsSearching(false);
// };
// const handleChange = async ($event: React.ChangeEvent<HTMLInputElement>) => {
// const { value } = $event.target;
// setSearchText(value);
// await searchTags(value);
// };
// const handleKeyPress = ($event: React.KeyboardEvent<HTMLInputElement>) => {
// if ($event.code === "Enter" || $event.code === "NumpadEnter") {
// __addTag(searchText);
// }
// };
// const __addTag = (tag: string) => {
// setTags([...tags, tag]);
// setSearchResults([]);
// setIsSearching(false);
// setSearchText("");
// };
// const doResultClick = ($event: any) =>
// __addTag($event.target.textContent as string);
// return (
// <>
// <label htmlFor="{name}" className="block text-sm font-medium">
// {label}
// </label>
// <div className="border-accent flex w-full rounded-lg border align-middle text-sm shadow-sm">
// <div className="flex flex-row space-x-1 pl-2 pt-3">
// {tags &&
// tags.map((tag) => (
// <span key={tag} className="badge badge-primary badge-lg py-0.5">
// {tag}
// <button
// onClick={() => removeTag(tag)}
// type="button"
// className="ml-0.5 inline-flex h-4 w-4 flex-shrink-0 items-center justify-center rounded-full"
// >
// <span className="sr-only">{tag}</span>
// <svg
// className="h-2 w-2"
// stroke="currentColor"
// fill="none"
// viewBox="0 0 8 8"
// >
// <path
// strokeLinecap="round"
// strokeWidth={1.5}
// d="M1 1l6 6m0-6L1 7"
// />
// </svg>
// </button>
// </span>
// ))}
// </div>
// <input
// value={searchText}
// onKeyDown={handleKeyPress}
// onChange={handleChange}
// placeholder="Start typing and press enter"
// className="input w-full focus:outline-none"
// />
// </div>
// {isSearching && (
// <div role="status" className="z-50 -mt-3 ml-5">
// <svg
// aria-hidden="true"
// className="mr-2 h-4 w-4"
// viewBox="0 0 100 101"
// fill="none"
// xmlns="http://www.w3.org/2000/svg"
// >
// <path
// d="M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z"
// fill="currentColor"
// />
// <path
// d="M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z"
// fill="currentFill"
// />
// </svg>
// <span className="sr-only">Loading...</span>
// </div>
// )}
// {searchResults && searchResults.length !== 0 && (
// <div className={`z-50 mb-4 flex space-y-0`}>
// <aside
// aria-labelledby="menu-heading"
// className="absolute z-50 -mt-5 flex w-64 flex-col items-start rounded-md border bg-white text-sm shadow-md"
// >
// <ul className="flex w-full flex-col">
// {searchResults.map((result) => (
// <li
// key={result}
// onClick={doResultClick}
// className="cursor-pointer space-x-2 px-2 py-1 hover:bg-indigo-500 hover:text-white focus:bg-indigo-500 focus:text-white focus:outline-none"
// >
// {result}
// </li>
// ))}
// </ul>
// </aside>
// </div>
// )}
// </>
// );
// };
export default TaggedInput;
// export default TaggedInput;

View File

@@ -3,13 +3,17 @@ import React, { Fragment } from "react";
import { Menu, Transition } from "@headlessui/react";
import { signOut } from "next-auth/react";
import { logger } from "@/lib/logger";
import { type Session } from "next-auth";
interface IUserNavDropdownProps {
session: any;
session: Session | null;
}
const UserNavDropdown: React.FC<IUserNavDropdownProps> = ({ session }) => {
const [profileImage, setProfileImage] = React.useState<string>();
React.useEffect(() => {
logger.debug("UserNavDropdown", "session", session);
setProfileImage(session?.user?.image || "/images/default-profile.jpg");
}, [session]);
return (
@@ -20,7 +24,7 @@ const UserNavDropdown: React.FC<IUserNavDropdownProps> = ({ session }) => {
<span className="sr-only">Open user menu</span>
<img
className="h-8 w-8 rounded-full"
src={session?.user?.image as string}
src={profileImage}
alt="Profile image"
/>
</Menu.Button>

View File

@@ -32,7 +32,7 @@ export const authOptions: NextAuthOptions = {
const s = {
...session,
user: {
...session.user
...session.user,
},
};
return s;
@@ -67,12 +67,7 @@ export const authOptions: NextAuthOptions = {
if (!user || user.length < 1) {
return null;
}
if (
!(await bcrypt.compare(
credentials.password,
user[0]!.password as string,
))
) {
if (!(await bcrypt.compare(credentials.password, user[0]!.password!))) {
return null;
}
return { id: user[0]!.id, email: user[0]!.email };