diff --git a/internal/auth/auth.go b/internal/auth/auth.go index 721b69a..8e3ca81 100644 --- a/internal/auth/auth.go +++ b/internal/auth/auth.go @@ -27,12 +27,11 @@ type Result struct { } func listenOnFreePort() (net.Listener, string, error) { - ln, err := net.Listen("tcp", "127.0.0.1:0") + ln, err := net.Listen("tcp", "127.0.0.1:8080") if err != nil { - return nil, "", fmt.Errorf("finding free port: %w", err) + return nil, "", fmt.Errorf("listening on port 8080: %w", err) } - port := ln.Addr().(*net.TCPAddr).Port - return ln, fmt.Sprintf("http://localhost:%d/callback", port), nil + return ln, "http://localhost:8080/callback", nil } // TwitterOAuth2 runs the OAuth 2.0 PKCE flow for Twitter/X. It opens the