From e52de5c634cc02b04d3b8f3ec89b54619a0c94f0 Mon Sep 17 00:00:00 2001 From: Miroslav Petrik Date: Wed, 15 Nov 2023 19:16:39 +0100 Subject: [PATCH] Use the configured passwordResetUrl in `auth-nextjs` When requesting reset password email, the URL from config is used, but was not really set during `auth` initialization. the `resetUrl` param is not supported, so I've removed it from the type. --- packages/auth-nextjs/src/app/index.ts | 2 +- packages/auth-nextjs/src/shared.ts | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/auth-nextjs/src/app/index.ts b/packages/auth-nextjs/src/app/index.ts index 7cbc41fdc..8f46141c9 100644 --- a/packages/auth-nextjs/src/app/index.ts +++ b/packages/auth-nextjs/src/app/index.ts @@ -466,7 +466,7 @@ export class NextAppAuth extends NextAuth { } }, emailPasswordSendPasswordResetEmail: async ( - data: FormData | { email: string; resetUrl: string } + data: FormData | { email: string } ) => { if (!this.options.passwordResetUrl) { throw new Error(`'passwordResetUrl' option not configured`); diff --git a/packages/auth-nextjs/src/shared.ts b/packages/auth-nextjs/src/shared.ts index ef7351b86..0b8148dfd 100644 --- a/packages/auth-nextjs/src/shared.ts +++ b/packages/auth-nextjs/src/shared.ts @@ -24,6 +24,7 @@ export abstract class NextAuth { authCookieName: options.authCookieName ?? "edgedb-session", pkceVerifierCookieName: options.pkceVerifierCookieName ?? "edgedb-pkce-verifier", + passwordResetUrl: options.passwordResetUrl, }; }