File tree Expand file tree Collapse file tree 2 files changed +6
-13
lines changed Expand file tree Collapse file tree 2 files changed +6
-13
lines changed Original file line number Diff line number Diff line change @@ -76,16 +76,12 @@ public async Task<AuthenticationPromptResult> GetAuthenticationAsync(Uri targetU
76
76
throw new ArgumentException ( @$ "Must specify at least one { nameof ( AuthenticationModes ) } ", nameof ( modes ) ) ;
77
77
}
78
78
79
- switch ( modes )
79
+ // If there is no mode choice to be made and no interaction required,
80
+ // just return that result.
81
+ if ( modes == AuthenticationModes . Browser ||
82
+ modes == AuthenticationModes . Device )
80
83
{
81
- case AuthenticationModes . Browser :
82
- // no user interaction required
83
- return new AuthenticationPromptResult ( AuthenticationModes . Browser ) ;
84
- case AuthenticationModes . Device :
85
- // no user interaction required
86
- return new AuthenticationPromptResult ( AuthenticationModes . Device ) ;
87
- default :
88
- break ;
84
+ return new AuthenticationPromptResult ( modes ) ;
89
85
}
90
86
91
87
ThrowIfUserInteractionDisabled ( ) ;
Original file line number Diff line number Diff line change @@ -316,10 +316,7 @@ public static bool IsGitHubDotCom(string targetUrl)
316
316
317
317
public static bool IsGitHubDotCom ( Uri targetUri )
318
318
{
319
- if ( targetUri is null )
320
- {
321
- throw new ArgumentNullException ( nameof ( targetUri ) ) ;
322
- }
319
+ EnsureArgument . AbsoluteUri ( targetUri , nameof ( targetUri ) ) ;
323
320
324
321
return StringComparer . OrdinalIgnoreCase . Equals ( targetUri . Host , GitHubConstants . GitHubBaseUrlHost ) ;
325
322
}
You can’t perform that action at this time.
0 commit comments