mirror of
https://github.com/warmbly/warmbly.git
synced 2026-09-06 08:01:24 +00:00
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.
16 lines
355 B
Go
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)
|
|
}
|