Fix portal account creation and improve email handling
All checks were successful
Build And Push Image / docker (push) Successful in 2m56s
All checks were successful
Build And Push Image / docker (push) Successful in 2m56s
- Add explicit POST method to portal account creation API call - Improve error handling with specific messages for different failure cases - Remove SMTP verification step that was causing issues with some servers - Make email sending non-critical to portal account creation success - Add better response data handling for keycloak_id - Add integration review documentation
This commit is contained in:
@@ -84,11 +84,14 @@ export class EmailService {
|
||||
host: this.config.host,
|
||||
port: this.config.port,
|
||||
secure: useSecure,
|
||||
// Connection timeout settings
|
||||
connectionTimeout: 30000, // 30 seconds
|
||||
greetingTimeout: 30000,
|
||||
socketTimeout: 30000,
|
||||
// Debug logging
|
||||
// Increased timeout settings to handle slow servers
|
||||
connectionTimeout: 60000, // 60 seconds
|
||||
greetingTimeout: 60000,
|
||||
socketTimeout: 60000,
|
||||
// Pool configuration for better connection management
|
||||
pool: false,
|
||||
maxConnections: 1,
|
||||
// Debug logging (can be enabled for troubleshooting)
|
||||
logger: false,
|
||||
debug: false
|
||||
};
|
||||
@@ -96,20 +99,32 @@ export class EmailService {
|
||||
// Add requireTLS if needed (for STARTTLS)
|
||||
if (requireTLS && !useSecure) {
|
||||
transporterOptions.requireTLS = true;
|
||||
transporterOptions.opportunisticTLS = true;
|
||||
}
|
||||
|
||||
// Configure TLS options
|
||||
transporterOptions.tls = {
|
||||
rejectUnauthorized: false, // Accept self-signed certificates
|
||||
// Don't specify minVersion or ciphers to allow auto-negotiation
|
||||
// Allow various TLS versions for compatibility
|
||||
minVersion: 'TLSv1',
|
||||
// Don't specify ciphers to allow auto-negotiation
|
||||
};
|
||||
|
||||
// Add authentication only if credentials are provided
|
||||
if (this.config.username && this.config.password) {
|
||||
transporterOptions.auth = {
|
||||
user: this.config.username,
|
||||
pass: this.config.password
|
||||
pass: this.config.password,
|
||||
// Try different auth methods for compatibility
|
||||
type: 'login' // Can be 'oauth2', 'login', or omitted for auto-detection
|
||||
};
|
||||
|
||||
// For some servers, disabling STARTTLS can help
|
||||
if (this.config.port === 587) {
|
||||
transporterOptions.ignoreTLS = false;
|
||||
transporterOptions.secure = false;
|
||||
transporterOptions.requireTLS = true;
|
||||
}
|
||||
}
|
||||
|
||||
this.transporter = nodemailer.createTransport(transporterOptions);
|
||||
|
||||
Reference in New Issue
Block a user