32 lines
784 B
TypeScript
32 lines
784 B
TypeScript
import { NextAuthOptions } from 'next-auth';
|
|
import CredentialsProvider from 'next-auth/providers/credentials';
|
|
|
|
export const authOptions: NextAuthOptions = {
|
|
providers: [
|
|
CredentialsProvider({
|
|
name: 'Credentials',
|
|
credentials: {
|
|
email: { label: 'Email', type: 'email' },
|
|
password: { label: 'Password', type: 'password' }
|
|
},
|
|
async authorize(credentials) {
|
|
if (!credentials?.email || !credentials?.password) {
|
|
return null;
|
|
}
|
|
|
|
// TODO: Implement actual authentication logic
|
|
return {
|
|
id: '1',
|
|
email: credentials.email,
|
|
name: credentials.email.split('@')[0],
|
|
};
|
|
}
|
|
})
|
|
],
|
|
session: {
|
|
strategy: 'jwt',
|
|
},
|
|
pages: {
|
|
signIn: '/login',
|
|
},
|
|
};
|