fix empty email profile in latest version of next-auth

This commit is contained in:
keyan 2023-10-13 19:50:50 -05:00
parent 8f034f0e0a
commit da3d5ffd5f

View File

@ -48,7 +48,7 @@ function getCallbacks (req) {
} }
// sign them up for the newsletter // sign them up for the newsletter
if (profile.email) { if (user?.email) {
fetch(process.env.LIST_MONK_URL + '/api/subscribers', { fetch(process.env.LIST_MONK_URL + '/api/subscribers', {
method: 'POST', method: 'POST',
headers: { headers: {
@ -56,7 +56,7 @@ function getCallbacks (req) {
Authorization: 'Basic ' + Buffer.from(process.env.LIST_MONK_AUTH).toString('base64') Authorization: 'Basic ' + Buffer.from(process.env.LIST_MONK_AUTH).toString('base64')
}, },
body: JSON.stringify({ body: JSON.stringify({
email: profile.email, email: user.email,
name: 'blank', name: 'blank',
lists: [2], lists: [2],
status: 'enabled', status: 'enabled',