Refactor client handling and improve error responses
docker-image / docker (push) Has been cancelled
goreleaser / goreleaser (push) Has been cancelled

- Centralized client retrieval logic with `getClient` function for reduced redundancy.
- Simplified client rotation and error handling by removing excessive load balancing logic.
- Updated server address in `auth.go` to use dynamic binding (`:8085`).
This commit is contained in:
Luis Pater
2025-07-15 17:03:18 +08:00
parent 368796349e
commit f49a530c1a
3 changed files with 10 additions and 52 deletions
+1 -1
View File
@@ -169,7 +169,7 @@ func getTokenFromWeb(ctx context.Context, config *oauth2.Config) (*oauth2.Token,
errChan := make(chan error)
// Create a new HTTP server.
server := &http.Server{Addr: "localhost:8085"}
server := &http.Server{Addr: ":8085"}
config.RedirectURL = "http://localhost:8085/oauth2callback"
http.HandleFunc("/oauth2callback", func(w http.ResponseWriter, r *http.Request) {