fix server session problem;

optimize
This commit is contained in:
Dobromir Popov
2024-05-11 17:57:33 +03:00
parent ffe68b492b
commit e29807540f
3 changed files with 38 additions and 19 deletions

View File

@ -70,21 +70,6 @@ export const authOptions: NextAuthOptions = {
password: { label: "Парола", type: "password" }
},
async authorize(credentials, req) {
//const user = { id: "1", name: "Администратора", email: "jsmith@example.com" }
//return user
// const res = await fetch("/your/endpoint", {
// method: 'POST',
// body: JSON.stringify(credentials),
// headers: { "Content-Type": "application/json" }
// })
// const user = await res.json()
// // If no error and we have user data, return it
// if (res.ok && user) {
// return user
// }
// // Return null if user data could not be retrieved
// return null
const users = [
{ id: "1", name: "admin", email: "admin@example.com", password: "admin123", role: "ADMIN", static: true },
{ id: "2", name: "krasi", email: "krasi@example.com", password: "krasi123", role: "ADMIN", static: true },
@ -272,6 +257,8 @@ export const authOptions: NextAuthOptions = {
verifyRequest: "/auth/verify-request", // (used for check email message)
newUser: null // If set, new users will be directed here on first sign in
},
debug: process.env.NODE_ENV === 'development',
}
export default NextAuth(authOptions)