fix(security): isolate NextAuth email provider from Nodemailer
This commit is contained in:
@@ -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;
|
||||
Reference in New Issue
Block a user