refactor: update application code to use unified configuration
- Update App.tsx to use getAppConfig() instead of import.meta.env - Update email templates to use getAppConfig() for base URL - Update database strategy to use getDatabaseConfig() function - Update mailgun service to use getter functions - Remove direct unified config imports in favor of functions - Ensure consistent configuration access throughout codebase
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
*/
|
||||
|
||||
import { getMailgunConfig, type MailgunConfig } from './mailgun.config';
|
||||
import { unifiedConfig } from '../config/unified.config';
|
||||
import { getAppConfig } from '../config/unified.config';
|
||||
|
||||
interface EmailTemplate {
|
||||
subject: string;
|
||||
@@ -139,13 +139,13 @@ export class MailgunService {
|
||||
}
|
||||
|
||||
async sendVerificationEmail(email: string, token: string): Promise<boolean> {
|
||||
const verificationUrl = `${unifiedConfig.app.baseUrl}/verify-email?token=${token}`;
|
||||
const verificationUrl = `${getAppConfig().baseUrl}/verify-email?token=${token}`;
|
||||
const template = this.getVerificationEmailTemplate(verificationUrl);
|
||||
return this.sendEmail(email, template);
|
||||
}
|
||||
|
||||
async sendPasswordResetEmail(email: string, token: string): Promise<boolean> {
|
||||
const resetUrl = `${unifiedConfig.app.baseUrl}/reset-password?token=${token}`;
|
||||
const resetUrl = `${getAppConfig().baseUrl}/reset-password?token=${token}`;
|
||||
const template = this.getPasswordResetEmailTemplate(resetUrl);
|
||||
return this.sendEmail(email, template);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user