Skip to content

Commit c1164f1

Browse files
authored
Fix silent mode on linux (#28)
1 parent b17ce0e commit c1164f1

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

cmd/oauth2.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import (
66
"encoding/json"
77
"errors"
88
"fmt"
9+
"io/ioutil"
910
"net/http"
1011
"os"
1112
"strings"
@@ -14,6 +15,7 @@ import (
1415
"github.com/cloudentity/oauth2c/internal/oauth2"
1516
"github.com/golang-jwt/jwt"
1617
"github.com/imdario/mergo"
18+
"github.com/pkg/browser"
1719
"github.com/spf13/cobra"
1820
)
1921

@@ -55,6 +57,10 @@ func OAuth2Cmd() *cobra.Command {
5557
cconfig.IssuerURL = strings.TrimSuffix(args[0], oauth2.OpenIDConfigurationPath)
5658
}
5759

60+
if silent {
61+
browser.Stdout = ioutil.Discard
62+
}
63+
5864
tr := &http.Transport{
5965
TLSClientConfig: &tls.Config{
6066
InsecureSkipVerify: cconfig.Insecure,

0 commit comments

Comments
 (0)