Files
warmbly/internal/app/auth/email.go
T
Matthew Meszaros 3837cd3898 feat: bound auth login network waits
Add request and mail-delivery timeouts around auth flows so login requests cannot hang indefinitely when notification delivery stalls.

Allow the local admin dev origin through default CORS and update context-aware lint fixes so the repository lint gate passes.
2026-06-01 16:56:24 +02:00

16 lines
355 B
Go

package auth
import (
"context"
"time"
)
const authEmailSendTimeout = 10 * time.Second
func (s *authService) sendAuthEmail(ctx context.Context, to, subject, message string) error {
ctx, cancel := context.WithTimeout(ctx, authEmailSendTimeout)
defer cancel()
return s.emailNotificationService.Send(ctx, []string{to}, nil, nil, subject, message)
}