This repository has been archived on 2023-10-27. You can view files and clone it, but cannot push or open issues or pull requests.
Files
imageify/src/pages/api/auth/[...nextauth].js

27 lines
619 B
JavaScript
Raw Normal View History

2022-11-13 20:20:16 +00:00
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" },
2022-11-13 20:20:16 +00:00
password: { label: "Password", type: "password" },
},
async authorize(credentials, req) {
console.log(credentials);
const user = { id: "1", name: "J Smith", email: "admin@example.com" };
2022-11-13 20:20:16 +00:00
if (user) {
return user;
} else {
return null;
}
},
}),
],
};
export default NextAuth(authOptions);