Логирование
This commit is contained in:
parent
89cfc834da
commit
56babba2e9
2 changed files with 6 additions and 3 deletions
|
|
@ -17,6 +17,8 @@ const SITE_URL = isProduction
|
||||||
|
|
||||||
console.log('[EMAIL] isDev:', isDev);
|
console.log('[EMAIL] isDev:', isDev);
|
||||||
console.log('[EMAIL] isProduction:', isProduction);
|
console.log('[EMAIL] isProduction:', isProduction);
|
||||||
|
console.log('[EMAIL] SMTP_BZ_API_KEY exists:', !!SMTP_BZ_API_KEY);
|
||||||
|
console.log('[EMAIL] SMTP_BZ_API_KEY length:', SMTP_BZ_API_KEY.length);
|
||||||
|
|
||||||
async function sendViaSmtpBz(options: EmailOptions): Promise<boolean> {
|
async function sendViaSmtpBz(options: EmailOptions): Promise<boolean> {
|
||||||
try {
|
try {
|
||||||
|
|
|
||||||
|
|
@ -59,19 +59,20 @@ export const POST: APIRoute = async ({ request, redirect }) => {
|
||||||
const verifyToken = Buffer.from(`${record.id}:${email}:${Date.now()}`).toString('base64').replace(/=/g, '');
|
const verifyToken = Buffer.from(`${record.id}:${email}:${Date.now()}`).toString('base64').replace(/=/g, '');
|
||||||
const verifyLink = `${getSiteUrl()}/auth/verify?token=${verifyToken}&userId=${record.id}`;
|
const verifyLink = `${getSiteUrl()}/auth/verify?token=${verifyToken}&userId=${record.id}`;
|
||||||
|
|
||||||
console.log('Verify link:', verifyLink);
|
console.log('[SIGNUP] Verify link:', verifyLink);
|
||||||
|
console.log('[SIGNUP] Sending verification email to:', email);
|
||||||
|
|
||||||
// Отправляем письмо с ссылкой подтверждения
|
// Отправляем письмо с ссылкой подтверждения
|
||||||
const html = generateVerifyEmailHtml(firstName || 'Пользователь', verifyLink);
|
const html = generateVerifyEmailHtml(firstName || 'Пользователь', verifyLink);
|
||||||
|
|
||||||
console.log('Sending email to:', email);
|
console.log('[SIGNUP] Creating verification email HTML...');
|
||||||
const emailSent = await sendEmail({
|
const emailSent = await sendEmail({
|
||||||
to: email,
|
to: email,
|
||||||
subject: 'Подтверждение регистрации — Автоюрист Сургут',
|
subject: 'Подтверждение регистрации — Автоюрист Сургут',
|
||||||
html
|
html
|
||||||
});
|
});
|
||||||
|
|
||||||
console.log('Verify email sent:', emailSent);
|
console.log('[SIGNUP] Email sent result:', emailSent);
|
||||||
|
|
||||||
return new Response(JSON.stringify({
|
return new Response(JSON.stringify({
|
||||||
success: true,
|
success: true,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue