Email verification Backend

This commit is contained in:
magdo
2025-10-24 21:16:23 +02:00
parent b9fedb3601
commit 7a9a676fc0
10 changed files with 8 additions and 9 deletions
@@ -120,7 +120,7 @@ export class TokenService {
try {
// Remove trailing slash from baseUrl if present
const cleanBaseUrl = baseUrl.replace(/\/$/, '');
return `${cleanBaseUrl}/api/auth/verify-email?token=${encodeURIComponent(token)}`;
return `${cleanBaseUrl}/verify-email?token=${encodeURIComponent(token)}`;
} catch (error) {
logError('TokenService.generateVerificationUrl error', error instanceof Error ? error : new Error(String(error)));
throw new Error('Failed to generate verification URL');
@@ -69,7 +69,7 @@ export class CreateUserCommandHandler {
private async sendVerificationEmailAsync(user: UserAggregate, token: string): Promise<void> {
try {
const baseUrl = process.env.APP_BASE_URL || 'http://localhost:3000';
const baseUrl = process.env.FRONTEND_URL || 'http://localhost:5173';
const verificationUrl = TokenService.generateVerificationUrl(baseUrl, token);
const emailSent = await this.emailService.sendVerificationEmail(