Skip to content

There can be more than Notion and Miro. AFFiNE(pronounced [ə‘fain]) is a next-gen knowledge base that brings planning, sorting and creating all together. Privacy first, open-source, customizable and ready to use.

fix(server): sender passed to nextauth is never used (#5938)

liuyia38f7ee252dd
diff --git a/packages/backend/server/src/core/auth/next-auth-options.ts b/packages/backend/server/src/core/auth/next-auth-options.ts
index f177fd0790..72b368b025 100644
--- a/packages/backend/server/src/core/auth/next-auth-options.ts
+++ b/packages/backend/server/src/core/auth/next-auth-options.ts
@@ -172,8 +172,6 @@ export const NextAuthOptionsProvider: FactoryProvider<NextAuthOptions> = {
nextAuthOptions.providers.push(
// @ts-expect-error esm interop issue
Email.default({
- server: config.mailer,
- from: config.mailer.from,
sendVerificationRequest: (params: SendVerificationRequestParams) =>
sendVerificationRequest(config, logger, mailer, session, params),
})
diff --git a/packages/backend/server/src/core/auth/utils/send-mail.ts b/packages/backend/server/src/core/auth/utils/send-mail.ts
index 9cc349bd53..fdc463d90c 100644
--- a/packages/backend/server/src/core/auth/utils/send-mail.ts
+++ b/packages/backend/server/src/core/auth/utils/send-mail.ts
@@ -11,7 +11,7 @@ export async function sendVerificationRequest(
session: SessionService,
params: SendVerificationRequestParams
) {
- const { identifier, url, provider } = params;
+ const { identifier, url } = params;
const urlWithToken = new URL(url);
const callbackUrl = urlWithToken.searchParams.get('callbackUrl') || '';
if (!callbackUrl) {
@@ -28,7 +28,6 @@ export async function sendVerificationRequest(
const result = await mailer.sendSignInEmail(urlWithToken.toString(), {
to: identifier,
- from: provider.from,
});
logger.log(`send verification email success: ${result.accepted.join(', ')}`);