diff --git a/auth/imap.go b/auth/imap.go index 0b8c4d3..268cedf 100644 --- a/auth/imap.go +++ b/auth/imap.go @@ -6,6 +6,8 @@ import ( "github.com/emersion/go-imap/client" "github.com/emersion/go-sasl" + + "git.sr.ht/~sircmpwn/tokidoki/debug" ) type IMAPProvider struct { @@ -43,6 +45,7 @@ func (prov *IMAPProvider) doAuth(next http.Handler, conn, err := prov.dial() if err != nil { + debug.Printf("Auth dial error: %v", err) http.Error(w, "Temporary authentication error, try again later", http.StatusServiceUnavailable) return } @@ -50,6 +53,7 @@ func (prov *IMAPProvider) doAuth(next http.Handler, auth := sasl.NewPlainClient("", user, pass) if err := conn.Authenticate(auth); err != nil { + debug.Printf("Auth error: %v", err) http.Error(w, "Invalid username or password", http.StatusUnauthorized) return }