Fix all biome linter errors (#541)
This commit is contained in:
parent
f23c73f6a5
commit
e5d654bf41
46 changed files with 317 additions and 275 deletions
|
|
@ -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' };
|
||||
|
|
|
|||
|
|
@ -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) {
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue