mirror of
https://gitea.com/gitea/tea.git
synced 2025-09-01 09:28:30 +02:00
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 <me@black-desk.cn> Reviewed-on: https://gitea.com/gitea/tea/pulls/794 Reviewed-by: blumia <blumia@noreply.gitea.com> Co-authored-by: Chen Linxuan <me@black-desk.cn> Co-committed-by: Chen Linxuan <me@black-desk.cn>
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user