fix local user email confirmation emails

This commit is contained in:
Dobromir Popov
2024-05-29 12:26:04 +03:00
parent a8f5bf36a2
commit e07fd5f02a
2 changed files with 5 additions and 0 deletions

View File

@ -19,6 +19,7 @@ import AzureADProvider from "next-auth/providers/azure-ad";
const common = require("../../../src/helpers/common");
import { isLoggedIn, setAuthTokens, clearAuthTokens, getAccessToken, getRefreshToken } from 'axios-jwt'
import { create } from "domain"
import { logger } from "src/helpers/common"
//console.log("appleID:", process.env.APPLE_APP_ID);
@ -96,6 +97,8 @@ export const authOptions: NextAuthOptions = {
where: { email: credentials.username },
data: { emailVerifyToken: emailVerifyToken }
});
console.log("resending email verification token to ", credentials.username);
logger.info("resending email verification token to ", credentials.username);
emailHelper.SendEmail_ValidateTemplate(credentials.username, emailVerifyToken);
throw new Error('Моля потвърди имейла си преди да влезеш в системата.');
}
@ -130,6 +133,7 @@ export const authOptions: NextAuthOptions = {
}
});
console.log("New local credential user created for publisher ", pub.firstName, " ", pub.lastName, " (", pub.email, ")");
logger.info("New local credential user created for publisher ", pub.firstName, " ", pub.lastName, " (", pub.email, ")");
emailHelper.SendEmail_ValidateTemplate(pub.email, emailVerifyToken, pub.firstName, pub.lastName);
//return newUser;
throw new Error("Моля проверете вашия имейл '" + credentials?.username + "' за да потвърдите регистрацията си.");

View File

@ -6,6 +6,7 @@ const { MailtrapClient } = require("mailtrap");
const nodemailer = require("nodemailer");
const CON = require("./const");
const CAL = require("./calendar");
const common = require("./common");
const Handlebars = require('handlebars');
// const { google } = require("googleapis");