Fix all biome linter errors (#541)

This commit is contained in:
Jared Palmer 2024-11-15 12:18:17 -05:00 committed by GitHub
parent f23c73f6a5
commit e5d654bf41
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
46 changed files with 317 additions and 275 deletions

View file

@ -65,16 +65,15 @@ export const register = async (
if (user) {
return { status: 'user_exists' } as RegisterActionState;
} else {
await createUser(validatedData.email, validatedData.password);
await signIn('credentials', {
email: validatedData.email,
password: validatedData.password,
redirect: false,
});
return { status: 'success' };
}
await createUser(validatedData.email, validatedData.password);
await signIn('credentials', {
email: validatedData.email,
password: validatedData.password,
redirect: false,
});
return { status: 'success' };
} catch (error) {
if (error instanceof z.ZodError) {
return { status: 'invalid_data' };

View file

@ -1,5 +1,5 @@
import { compare } from 'bcrypt-ts';
import NextAuth, { User, Session } from 'next-auth';
import NextAuth, { type User, type Session } from 'next-auth';
import Credentials from 'next-auth/providers/credentials';
import { getUser } from '@/lib/db/queries';
@ -20,11 +20,13 @@ export const {
providers: [
Credentials({
credentials: {},
// biome-ignore lint/suspicious/noExplicitAny: TODO
async authorize({ email, password }: any) {
let users = await getUser(email);
const users = await getUser(email);
if (users.length === 0) return null;
let passwordsMatch = await compare(password, users[0].password!);
if (passwordsMatch) return users[0] as any;
const passwordsMatch = await compare(password, users[0].password!);
// biome-ignore lint/suspicious/noExplicitAny: TODO
return users[0] as any;
},
}),
],
@ -41,6 +43,7 @@ export const {
token,
}: {
session: ExtendedSession;
// biome-ignore lint/suspicious/noExplicitAny: TODO
token: any;
}) {
if (session.user) {

View file

@ -8,7 +8,7 @@ import { toast } from 'sonner';
import { AuthForm } from '@/components/auth-form';
import { SubmitButton } from '@/components/submit-button';
import { login, LoginActionState } from '../actions';
import { login, type LoginActionState } from '../actions';
export default function Page() {
const router = useRouter();