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

This commit is contained in:
liuyi 2024-02-28 05:44:25 +00:00
parent 27f2209e87
commit a38f7ee252
No known key found for this signature in database
GPG Key ID: 56709255DC7EC728
2 changed files with 1 additions and 4 deletions

View File

@ -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),
})

View File

@ -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(', ')}`);