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:
@@ -51,18 +51,11 @@ export default defineEventHandler(async (event) => {
|
||||
const { getEmailService } = await import('~/server/utils/email');
|
||||
const emailService = await getEmailService();
|
||||
|
||||
// Try to verify connection but don't fail if verification doesn't work
|
||||
// Some SMTP servers have issues with verify() but work fine for sending
|
||||
try {
|
||||
const connectionOk = await emailService.verifyConnection();
|
||||
if (connectionOk) {
|
||||
console.log('[api/admin/test-email.post] SMTP connection verified successfully');
|
||||
}
|
||||
} catch (verifyError: any) {
|
||||
console.warn('[api/admin/test-email.post] SMTP verification failed, attempting to send anyway:', verifyError.message);
|
||||
}
|
||||
|
||||
// Attempt to send test email regardless of verification result
|
||||
// Skip verification entirely and just try to send
|
||||
// Many SMTP servers don't support the VERIFY command
|
||||
console.log('[api/admin/test-email.post] Attempting to send test email without verification...');
|
||||
|
||||
// Attempt to send test email directly
|
||||
await emailService.sendTestEmail(body.testEmail);
|
||||
|
||||
console.log('[api/admin/test-email.post] ✅ Test email sent successfully');
|
||||
|
||||
Reference in New Issue
Block a user