fixing ports

This commit is contained in:
2026-04-29 14:02:25 -06:00
parent 0f2e91bfa3
commit 451bdf2c75
+3 -4
View File
@@ -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