start working on next auth

This commit is contained in:
Liam
2022-11-13 20:20:16 +00:00
parent 410c2e1cc5
commit 67a0dccb95
2 changed files with 33 additions and 4 deletions

View File

@ -0,0 +1,26 @@
import NextAuth from "next-auth";
import CredentialsProvider from "next-auth/providers/credentials";
export const authOptions = {
providers: [
CredentialsProvider({
name: "Credentials",
credentials: {
username: { label: "Username", type: "text", placeholder: "admin" },
password: { label: "Password", type: "password" },
},
async authorize(credentials, req) {
console.log(credentials);
const user = { id: "1", name: "J Smith", email: "admin@example.com" };
if (user) {
return user;
} else {
return null;
}
},
}),
],
};
export default NextAuth(authOptions);