fix: eslint disable-next-line for required any casts (NextAuth v4 limitation)
This commit is contained in:
@@ -22,6 +22,7 @@ import { checkRateLimit, recordFailedAttempt, clearAttempts } from '@/lib/rate-l
|
|||||||
const mockFindUnique = prisma.user.findUnique as jest.Mock
|
const mockFindUnique = prisma.user.findUnique as jest.Mock
|
||||||
|
|
||||||
describe('NextAuth authorize', () => {
|
describe('NextAuth authorize', () => {
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
const authorize = (authOptions.providers[0] as any).options.authorize
|
const authorize = (authOptions.providers[0] as any).options.authorize
|
||||||
|
|
||||||
beforeEach(() => jest.clearAllMocks())
|
beforeEach(() => jest.clearAllMocks())
|
||||||
|
|||||||
+2
-2
@@ -45,8 +45,8 @@ export const authOptions: NextAuthOptions = {
|
|||||||
|
|
||||||
// NextAuth v4 : req est un RequestInternal partiel sans typings complets.
|
// NextAuth v4 : req est un RequestInternal partiel sans typings complets.
|
||||||
// Le cast est nécessaire pour accéder à x-forwarded-for.
|
// Le cast est nécessaire pour accéder à x-forwarded-for.
|
||||||
const ip =
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||||
(req as any)?.headers?.['x-forwarded-for']?.split(',')[0]?.trim() ?? 'unknown'
|
const ip = (req as any)?.headers?.['x-forwarded-for']?.split(',')[0]?.trim() ?? 'unknown'
|
||||||
const key = `${ip}:${credentials.email}`
|
const key = `${ip}:${credentials.email}`
|
||||||
|
|
||||||
if (!checkRateLimit(key)) {
|
if (!checkRateLimit(key)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user