@@ -26,8 +26,8 @@ func IsGitHubApp(id string) bool {
2626 return id == "178c6fc778ccc68e1d6a" || id == "4d747ba5675d5d66553f"
2727}
2828
29- func AuthFlowWithConfig (cfg Config , hostname , notice string ) (string , error ) {
30- token , userLogin , err := authFlow (hostname , notice )
29+ func AuthFlowWithConfig (cfg Config , hostname , notice string , additionalScopes [] string ) (string , error ) {
30+ token , userLogin , err := authFlow (hostname , notice , additionalScopes )
3131 if err != nil {
3232 return "" , err
3333 }
@@ -50,17 +50,20 @@ func AuthFlowWithConfig(cfg Config, hostname, notice string) (string, error) {
5050 return token , nil
5151}
5252
53- func authFlow (oauthHost , notice string ) (string , string , error ) {
53+ func authFlow (oauthHost , notice string , additionalScopes [] string ) (string , string , error ) {
5454 var verboseStream io.Writer
5555 if strings .Contains (os .Getenv ("DEBUG" ), "oauth" ) {
5656 verboseStream = os .Stderr
5757 }
5858
59+ minimumScopes := []string {"repo" , "read:org" , "gist" }
60+ scopes := append (minimumScopes , additionalScopes ... )
61+
5962 flow := & auth.OAuthFlow {
6063 Hostname : oauthHost ,
6164 ClientID : oauthClientID ,
6265 ClientSecret : oauthClientSecret ,
63- Scopes : [] string { "repo" , "read:org" , "gist" } ,
66+ Scopes : scopes ,
6467 WriteSuccessHTML : func (w io.Writer ) {
6568 fmt .Fprintln (w , oauthSuccessPage )
6669 },
0 commit comments