Merge pull request #2149 from tidusjar/develop

Removed some early disposition that seemed to be causing errors in th…
pull/2200/head v3.0.3173
Jamie 7 years ago committed by GitHub
commit 2f2cc6445b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -168,7 +168,6 @@ namespace Ombi
if (user == null) if (user == null)
{ {
context.Response.StatusCode = (int)HttpStatusCode.Unauthorized; context.Response.StatusCode = (int)HttpStatusCode.Unauthorized;
context.Response.RegisterForDispose(um);
await context.Response.WriteAsync("Invalid User Access Token"); await context.Response.WriteAsync("Invalid User Access Token");
} }
else else
@ -178,7 +177,6 @@ namespace Ombi
var roles = await um.GetRolesAsync(user); var roles = await um.GetRolesAsync(user);
var principal = new GenericPrincipal(identity, roles.ToArray()); var principal = new GenericPrincipal(identity, roles.ToArray());
context.User = principal; context.User = principal;
context.Response.RegisterForDispose(um);
await next(); await next();
} }
} }
@ -191,7 +189,6 @@ namespace Ombi
if (!valid) if (!valid)
{ {
context.Response.StatusCode = (int)HttpStatusCode.Unauthorized; context.Response.StatusCode = (int)HttpStatusCode.Unauthorized;
context.Response.RegisterForDispose(settingsProvider);
await context.Response.WriteAsync("Invalid API Key"); await context.Response.WriteAsync("Invalid API Key");
} }
else else
@ -199,7 +196,6 @@ namespace Ombi
var identity = new GenericIdentity("API"); var identity = new GenericIdentity("API");
var principal = new GenericPrincipal(identity, new[] { "Admin", "ApiUser" }); var principal = new GenericPrincipal(identity, new[] { "Admin", "ApiUser" });
context.User = principal; context.User = principal;
context.Response.RegisterForDispose(settingsProvider);
await next(); await next();
} }
} }

Loading…
Cancel
Save