fix(security): isolate NextAuth email provider from Nodemailer

This commit is contained in:
2026-11-04 11:26:01 +00:00
parent d9f0c0797d
commit 569faa77e5
5 changed files with 148 additions and 4 deletions
+31
View File
@@ -0,0 +1,31 @@
/**
* NextAuth email provider configuration for PEDW.
*
* PEDW supplies its own sendVerificationRequest implementation using
* GOV.UK Notify, so the default Nodemailer SMTP sender is unnecessary.
*
* Preserve the NextAuth v4 email provider configuration contract.
*/
const EmailProvider = (options = {}) => ({
id: "email",
type: "email",
name: "Email",
server: {
host: "localhost",
port: 25,
auth: {
user: "",
pass: ""
}
},
from: "NextAuth <no-reply@example.com>",
maxAge: 24 * 60 * 60,
async sendVerificationRequest() {
throw new Error(
"PEDW requires a custom GOV.UK Notify verification sender"
);
},
options
});
export default EmailProvider;