Email verification Backend
This commit is contained in:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user