Skip to content

Commit

Permalink
Show link to the auth page even if we couldn't open a browser. (#53)
Browse files Browse the repository at this point in the history
* Show link to the auth page even if we couldn't open a browser.

In case if we couldn't open a browser using `xdg-open` (For
example xdg-utils can be not installed in the system) -- user will still able to
follow the link (copy-paste from the terminal) and obtain oauth code.

Message will look like this:
```
Can't open browser (exec: "xdg-open": executable file not found in $PATH: ). Please follow the link: https://accounts.google.com/o/oauth2
```

* Add line break.

Co-Authored-By: Matt Holt <[email protected]>
  • Loading branch information
AyumuKasuga and mholt committed Dec 8, 2019
1 parent 92ecec5 commit 7bd76a1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
_gitignore/
_storage/
oauth2client/oauth2proxy/cmd/oauth2proxy/credentials.toml
cmd/timeliner/timeliner.toml
**/timeliner.toml
cmc/timeliner/timeliner
2 changes: 1 addition & 1 deletion oauth2client/browser.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ func (b Browser) Get(expectedStateVal, authCodeURL string) (string, error) {

err = openBrowser(authCodeURL)
if err != nil {
return "", err
fmt.Printf("Can't open browser: %s.\nPlease follow this link: %s", err, authCodeURL)
}

select {
Expand Down

0 comments on commit 7bd76a1

Please sign in to comment.