Revert "Upgrade linter and formatter to Ultracite" (#1226)

This commit is contained in:
josh 2025-09-21 12:03:29 +01:00 committed by GitHub
parent 0e320b391d
commit 1aff7d9868
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
177 changed files with 8334 additions and 6943 deletions

View file

@ -1,22 +1,21 @@
import { compare } from "bcrypt-ts";
import NextAuth, { type DefaultSession } from "next-auth";
import type { DefaultJWT } from "next-auth/jwt";
import Credentials from "next-auth/providers/credentials";
import { DUMMY_PASSWORD } from "@/lib/constants";
import { createGuestUser, getUser } from "@/lib/db/queries";
import { authConfig } from "./auth.config";
import { compare } from 'bcrypt-ts';
import NextAuth, { type DefaultSession } from 'next-auth';
import Credentials from 'next-auth/providers/credentials';
import { createGuestUser, getUser } from '@/lib/db/queries';
import { authConfig } from './auth.config';
import { DUMMY_PASSWORD } from '@/lib/constants';
import type { DefaultJWT } from 'next-auth/jwt';
export type UserType = "guest" | "regular";
export type UserType = 'guest' | 'regular';
declare module "next-auth" {
declare module 'next-auth' {
interface Session extends DefaultSession {
user: {
id: string;
type: UserType;
} & DefaultSession["user"];
} & DefaultSession['user'];
}
// biome-ignore lint/nursery/useConsistentTypeDefinitions: "Required"
interface User {
id?: string;
email?: string | null;
@ -24,7 +23,7 @@ declare module "next-auth" {
}
}
declare module "next-auth/jwt" {
declare module 'next-auth/jwt' {
interface JWT extends DefaultJWT {
id: string;
type: UserType;
@ -58,24 +57,22 @@ export const {
const passwordsMatch = await compare(password, user.password);
if (!passwordsMatch) {
return null;
}
if (!passwordsMatch) return null;
return { ...user, type: "regular" };
return { ...user, type: 'regular' };
},
}),
Credentials({
id: "guest",
id: 'guest',
credentials: {},
async authorize() {
const [guestUser] = await createGuestUser();
return { ...guestUser, type: "guest" };
return { ...guestUser, type: 'guest' };
},
}),
],
callbacks: {
jwt({ token, user }) {
async jwt({ token, user }) {
if (user) {
token.id = user.id as string;
token.type = user.type;
@ -83,7 +80,7 @@ export const {
return token;
},
session({ session, token }) {
async session({ session, token }) {
if (session.user) {
session.user.id = token.id;
session.user.type = token.type;