feat: configure email provider with Resend
This commit is contained in:
parent
330367dcc8
commit
6b068e37f8
1 changed files with 14 additions and 1 deletions
15
src/auth.ts
15
src/auth.ts
|
|
@ -2,6 +2,7 @@ import NextAuth from "next-auth";
|
|||
import { DrizzleAdapter } from "@auth/drizzle-adapter";
|
||||
import { db } from "@/db";
|
||||
import { accounts, sessions, users, verificationTokens } from "@/db/schema/auth";
|
||||
import Email from "next-auth/providers/email";
|
||||
|
||||
export const { handlers, auth, signIn, signOut } = NextAuth({
|
||||
adapter: DrizzleAdapter(db, {
|
||||
|
|
@ -10,7 +11,19 @@ export const { handlers, auth, signIn, signOut } = NextAuth({
|
|||
usersTable: users,
|
||||
verificationTokensTable: verificationTokens,
|
||||
}),
|
||||
providers: [],
|
||||
providers: [
|
||||
Email({
|
||||
server: {
|
||||
host: "smtp.resend.com",
|
||||
port: 587,
|
||||
auth: {
|
||||
user: "resend",
|
||||
pass: process.env.RESEND_API_KEY,
|
||||
},
|
||||
},
|
||||
from: "Tia <tia@manohargupta.com>",
|
||||
}),
|
||||
],
|
||||
pages: {
|
||||
signIn: "/login",
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue