This repository was archived by the owner on Dec 5, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +4
-5
lines changed
GitHub.Api/Authentication
tests/UnitTests/Authentication Expand file tree Collapse file tree 2 files changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -17,11 +17,13 @@ public void Set(ICredential credential)
1717 public void UpdateToken ( string token )
1818 {
1919 Credential . UpdateToken ( token ) ;
20+ OctokitCredentials = new Credentials ( OctokitCredentials . Login , token ) ;
2021 }
2122
2223 public void Clear ( )
2324 {
2425 OctokitCredentials = Credentials . Anonymous ;
26+ Credential = null ;
2527 }
2628
2729 /// <summary>
Original file line number Diff line number Diff line change @@ -392,7 +392,7 @@ public void ShouldConnectSetCredentialsTokenAndSave()
392392 keychainAdapter . Credential . Token . Should ( ) . Be ( token ) ;
393393 keychainAdapter . OctokitCredentials . AuthenticationType . Should ( ) . Be ( AuthenticationType . Basic ) ;
394394 keychainAdapter . OctokitCredentials . Login . Should ( ) . Be ( username ) ;
395- keychainAdapter . OctokitCredentials . Password . Should ( ) . Be ( password ) ;
395+ keychainAdapter . OctokitCredentials . Password . Should ( ) . Be ( token ) ;
396396
397397 keychain . Save ( hostUri ) . Wait ( ) ;
398398
@@ -472,10 +472,7 @@ public void ShouldConnectSetCredentialsAndClear()
472472
473473 keychain . Clear ( hostUri , false ) . Wait ( ) ;
474474
475- keychainAdapter . Credential . Should ( ) . NotBeNull ( ) ;
476- keychainAdapter . Credential . Host . Should ( ) . Be ( hostUri ) ;
477- keychainAdapter . Credential . Username . Should ( ) . Be ( username ) ;
478- keychainAdapter . Credential . Token . Should ( ) . Be ( password ) ;
475+ keychainAdapter . Credential . Should ( ) . BeNull ( ) ;
479476 keychainAdapter . OctokitCredentials . AuthenticationType . Should ( ) . Be ( AuthenticationType . Anonymous ) ;
480477 keychainAdapter . OctokitCredentials . Login . Should ( ) . BeNull ( ) ;
481478 keychainAdapter . OctokitCredentials . Password . Should ( ) . BeNull ( ) ;
You can’t perform that action at this time.
0 commit comments