linter fixes

This commit is contained in:
2025-05-27 15:07:33 +03:00
parent b30796ae4b
commit 85349bf961
16 changed files with 991 additions and 1295 deletions

View File

@@ -1,5 +1,4 @@
import NextAuth, { NextAuthOptions } from 'next-auth'
import GoogleProvider from 'next-auth/providers/google'
import CredentialsProvider from 'next-auth/providers/credentials'
import { JWT } from 'next-auth/jwt'
@@ -75,21 +74,18 @@ export const authOptions: NextAuthOptions = {
throw new Error('Все поля обязательны для заполнения')
}
const res = await fetch(
`${process.env.BACKEND_URL}/register/clients/`,
{
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
email: credentials.email,
password: credentials.password,
name: credentials.name,
surname: credentials.surname,
phone_number: credentials.phone_number,
privacy_accepted: credentials.privacy_accepted === 'true',
}),
}
)
const res = await fetch(`${process.env.BACKEND_URL}/register/clients/`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
email: credentials.email,
password: credentials.password,
name: credentials.name,
surname: credentials.surname,
phone_number: credentials.phone_number,
privacy_accepted: credentials.privacy_accepted === 'true',
}),
})
const data = await res.json()
@@ -126,17 +122,14 @@ export const authOptions: NextAuthOptions = {
},
async authorize(credentials) {
try {
const res = await fetch(
`${process.env.BACKEND_URL}/auth/login/clients/`,
{
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
email: credentials?.email,
password: credentials?.password,
}),
}
)
const res = await fetch(`${process.env.BACKEND_URL}/auth/login/clients/`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
email: credentials?.email,
password: credentials?.password,
}),
})
const data = await res.json()