You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Oct 29, 2024. It is now read-only.
I have filed the bug on with Refit, but was wondering if something is already known about this.
I am trying to use IJSRuntime in Refit as for Adding Auth token using Delegating handler.
Hi @nssidhu , I think I've seen things like this happen when the wrong Dependency Injection (DI) scope is used. I think the IJSRuntime service can be consumed only from transitive or scoped services, but not from singleton service. Maybe that's the issue here?
I tried all singleton, transient & scoped, same error
builder.Services.AddScoped<RefitAuthHeaderHandler>();
var setting = new RefitSettings
{
ContentSerializer = new NewtonsoftJsonContentSerializer(
new JsonSerializerSettings
{
ContractResolver = new CamelCasePropertyNamesContractResolver()
})
};
builder.Services.AddRefitClient<IXXXXXXXHttpAPI>(setting)
.ConfigureHttpClient(c =>
{
c.BaseAddress = new System.Uri("https://XXXXXppdev.azurewebsites.net/api");
})
.AddHttpMessageHandler<RefitAuthHeaderHandler>();
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
@Eilon
I have filed the bug on with Refit, but was wondering if something is already known about this.
I am trying to use IJSRuntime in Refit as for Adding Auth token using Delegating handler.
reactiveui/refit#1316
The text was updated successfully, but these errors were encountered: