fixes and improvements

This commit is contained in:
Daniel
2023-07-12 16:34:05 -04:00
parent 0bcb8515a0
commit 7be3b37b21
6 changed files with 25 additions and 31 deletions
+4
View File
@@ -10,6 +10,8 @@ import { Adapter } from "next-auth/adapters";
import sendVerificationRequest from "@/lib/api/sendVerificationRequest";
import { Provider } from "next-auth/providers";
let email;
const providers: Provider[] = [
CredentialsProvider({
type: "credentials",
@@ -63,6 +65,7 @@ if (process.env.EMAIL_SERVER && process.env.EMAIL_FROM)
from: process.env.EMAIL_FROM,
maxAge: 600,
sendVerificationRequest(params) {
email = params.identifier;
sendVerificationRequest(params);
},
})
@@ -76,6 +79,7 @@ export const authOptions: AuthOptions = {
providers,
pages: {
signIn: "/login",
verifyRequest: "/confirmation",
},
callbacks: {
session: async ({ session, token }: { session: Session; token: JWT }) => {