make Grpc.Auth build again
This commit is contained in:
parent
d4e778ca2f
commit
fb85fb8c19
|
|
@ -61,7 +61,7 @@ namespace Grpc.Auth
|
|||
return new AsyncAuthInterceptor((context, metadata) =>
|
||||
{
|
||||
metadata.Add(CreateBearerTokenHeader(accessToken));
|
||||
return TaskUtils.CompletedTask;
|
||||
return GetCompletedTask();
|
||||
});
|
||||
}
|
||||
|
||||
|
|
@ -69,5 +69,17 @@ namespace Grpc.Auth
|
|||
{
|
||||
return new Metadata.Entry(AuthorizationHeader, Schema + " " + accessToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Framework independent equivalent of <c>Task.CompletedTask</c>.
|
||||
/// </summary>
|
||||
private static Task GetCompletedTask()
|
||||
{
|
||||
#if NETSTANDARD1_5 || NETSTANDARD2_0
|
||||
return Task.CompletedTask;
|
||||
#else
|
||||
return Task.FromResult<object>(null); // for .NET45, emulate the functionality
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue