@@ -42,10 +42,10 @@ public enum AuthenticationModes
42
42
{
43
43
None = 0 ,
44
44
Basic = 1 ,
45
- OAuth = 1 << 1 ,
45
+ Browser = 1 << 1 ,
46
46
Pat = 1 << 2 ,
47
47
48
- All = Basic | OAuth | Pat
48
+ All = Basic | Browser | Pat
49
49
}
50
50
51
51
public class GitHubAuthentication : AuthenticationBase , IGitHubAuthentication
@@ -76,9 +76,9 @@ public async Task<AuthenticationPromptResult> GetAuthenticationAsync(Uri targetU
76
76
}
77
77
else
78
78
{
79
- if ( ( modes & AuthenticationModes . Basic ) != 0 ) promptArgs . Append ( " --basic" ) ;
80
- if ( ( modes & AuthenticationModes . OAuth ) != 0 ) promptArgs . Append ( " --oauth " ) ;
81
- if ( ( modes & AuthenticationModes . Pat ) != 0 ) promptArgs . Append ( " --pat" ) ;
79
+ if ( ( modes & AuthenticationModes . Basic ) != 0 ) promptArgs . Append ( " --basic" ) ;
80
+ if ( ( modes & AuthenticationModes . Browser ) != 0 ) promptArgs . Append ( " --browser " ) ;
81
+ if ( ( modes & AuthenticationModes . Pat ) != 0 ) promptArgs . Append ( " --pat" ) ;
82
82
}
83
83
if ( ! GitHubHostProvider . IsGitHubDotCom ( targetUri ) ) promptArgs . AppendFormat ( " --enterprise-url {0}" , QuoteCmdArg ( targetUri . ToString ( ) ) ) ;
84
84
if ( ! string . IsNullOrWhiteSpace ( userName ) ) promptArgs . AppendFormat ( " --username {0}" , QuoteCmdArg ( userName ) ) ;
@@ -101,8 +101,8 @@ public async Task<AuthenticationPromptResult> GetAuthenticationAsync(Uri targetU
101
101
return new AuthenticationPromptResult (
102
102
AuthenticationModes . Pat , new GitCredential ( userName , pat ) ) ;
103
103
104
- case "oauth " :
105
- return new AuthenticationPromptResult ( AuthenticationModes . OAuth ) ;
104
+ case "browser " :
105
+ return new AuthenticationPromptResult ( AuthenticationModes . Browser ) ;
106
106
107
107
case "basic" :
108
108
if ( ! resultDict . TryGetValue ( "username" , out userName ) )
@@ -145,8 +145,8 @@ public async Task<AuthenticationPromptResult> GetAuthenticationAsync(Uri targetU
145
145
return new AuthenticationPromptResult (
146
146
AuthenticationModes . Basic , new GitCredential ( userName , password ) ) ;
147
147
148
- case AuthenticationModes . OAuth :
149
- return new AuthenticationPromptResult ( AuthenticationModes . OAuth ) ;
148
+ case AuthenticationModes . Browser :
149
+ return new AuthenticationPromptResult ( AuthenticationModes . Browser ) ;
150
150
151
151
case AuthenticationModes . Pat :
152
152
Context . Terminal . WriteLine ( "Enter GitHub personal access token for '{0}'..." , targetUri ) ;
@@ -161,20 +161,20 @@ public async Task<AuthenticationPromptResult> GetAuthenticationAsync(Uri targetU
161
161
var menuTitle = $ "Select an authentication method for '{ targetUri } '";
162
162
var menu = new TerminalMenu ( Context . Terminal , menuTitle ) ;
163
163
164
- TerminalMenuItem oauthItem = null ;
164
+ TerminalMenuItem browserItem = null ;
165
165
TerminalMenuItem basicItem = null ;
166
166
TerminalMenuItem patItem = null ;
167
167
168
- if ( ( modes & AuthenticationModes . OAuth ) != 0 ) oauthItem = menu . Add ( "Web browser" ) ;
169
- if ( ( modes & AuthenticationModes . Pat ) != 0 ) patItem = menu . Add ( "Personal access token" ) ;
170
- if ( ( modes & AuthenticationModes . Basic ) != 0 ) basicItem = menu . Add ( "Username/password" ) ;
168
+ if ( ( modes & AuthenticationModes . Browser ) != 0 ) browserItem = menu . Add ( "Web browser" ) ;
169
+ if ( ( modes & AuthenticationModes . Pat ) != 0 ) patItem = menu . Add ( "Personal access token" ) ;
170
+ if ( ( modes & AuthenticationModes . Basic ) != 0 ) basicItem = menu . Add ( "Username/password" ) ;
171
171
172
172
// Default to the 'first' choice in the menu
173
173
TerminalMenuItem choice = menu . Show ( 0 ) ;
174
174
175
- if ( choice == oauthItem ) goto case AuthenticationModes . OAuth ;
176
- if ( choice == basicItem ) goto case AuthenticationModes . Basic ;
177
- if ( choice == patItem ) goto case AuthenticationModes . Pat ;
175
+ if ( choice == browserItem ) goto case AuthenticationModes . Browser ;
176
+ if ( choice == basicItem ) goto case AuthenticationModes . Basic ;
177
+ if ( choice == patItem ) goto case AuthenticationModes . Pat ;
178
178
179
179
throw new Exception ( ) ;
180
180
}
0 commit comments