From 8876fe3cb8c3c6d9d0519bb15cdcd746b9b02ba0 Mon Sep 17 00:00:00 2001 From: Chen Linxuan Date: Mon, 18 Aug 2025 03:12:25 +0000 Subject: [PATCH] Continue auth when failed to open browser (#794) When users login gitea on a headless server via ssh, xdg-open might not be installed on that machine. So tea may fail to open URL itself. In this case, users can use the other machine to open the URL for authentication. Github CLI act like this, too. Signed-off-by: Chen Linxuan Reviewed-on: https://gitea.com/gitea/tea/pulls/794 Reviewed-by: blumia Co-authored-by: Chen Linxuan Co-committed-by: Chen Linxuan --- modules/auth/oauth.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/auth/oauth.go b/modules/auth/oauth.go index 05db3ec..33d92ec 100644 --- a/modules/auth/oauth.go +++ b/modules/auth/oauth.go @@ -336,7 +336,7 @@ func startLocalServerAndOpenBrowser(authURL, expectedState string, opts OAuthOpt // Open browser fmt.Println("Opening browser for authorization...") if err := openBrowser(authURL); err != nil { - return "", "", fmt.Errorf("failed to open browser: %s", err) + fmt.Println("Failed to open browser: ", err) } // Wait for code, error, or timeout