linter fixes
This commit is contained in:
@@ -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()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user