File tree 1 file changed +3
-3
lines changed
src/KubernetesClient/Authentication
1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -17,15 +17,15 @@ public TokenFileAuth(string tokenFile)
17
17
TokenFile = tokenFile ;
18
18
}
19
19
20
- #if NETSTANDARD2_1_OR_GREATER
20
+ #if NETSTANDARD2_1_OR_GREATER || NET5_0_OR_GREATER
21
21
public async Task < AuthenticationHeaderValue > GetAuthenticationHeaderAsync ( CancellationToken cancellationToken )
22
22
#else
23
23
public Task < AuthenticationHeaderValue > GetAuthenticationHeaderAsync ( CancellationToken cancellationToken )
24
24
#endif
25
25
{
26
26
if ( TokenExpiresAt < DateTime . UtcNow )
27
27
{
28
- #if NETSTANDARD2_1_OR_GREATER
28
+ #if NETSTANDARD2_1_OR_GREATER || NET5_0_OR_GREATER
29
29
token = await File . ReadAllTextAsync ( TokenFile , cancellationToken )
30
30
. ContinueWith ( r => r . Result . Trim ( ) , cancellationToken )
31
31
. ConfigureAwait ( false ) ;
@@ -40,7 +40,7 @@ public Task<AuthenticationHeaderValue> GetAuthenticationHeaderAsync(Cancellation
40
40
// < 10-8-1 minute.
41
41
TokenExpiresAt = DateTime . UtcNow . AddMinutes ( 1 ) ;
42
42
}
43
- #if NETSTANDARD2_1_OR_GREATER
43
+ #if NETSTANDARD2_1_OR_GREATER || NET5_0_OR_GREATER
44
44
return new AuthenticationHeaderValue ( "Bearer" , token ) ;
45
45
#else
46
46
return Task . FromResult ( new AuthenticationHeaderValue ( "Bearer" , token ) ) ;
You can’t perform that action at this time.
0 commit comments