This commit is contained in:
2020-05-08 23:16:00 +00:00
parent 94bb06e249
commit c016031f01
2 changed files with 4 additions and 3 deletions

View File

@@ -398,11 +398,11 @@ namespace AyaNova
context.Request.HttpContext.Items["AY_TRANSLATION_ID"] = u.translationId;
//CHECK JWT
if (u.currentAuthToken != JWT)
if (!context.Request.Path.Value.EndsWith("/Auth") && u.currentAuthToken != JWT)//except "/api/v8/Auth" so user can login May need other routes later?
{
context.Response.StatusCode = 401;
context.Response.Headers.Add("X-AyaNova-Authorization-Error", "Authorization token was replaced by more recent login");
await context.Response.WriteAsync("Authorization token was replaced by more recent login");
context.Response.Headers.Add("X-AyaNova-Authorization-Error", "E2006 - Authorization token replaced by more recent login");
await context.Response.WriteAsync("E2006 - Authorization token replaced by more recent login");
}
else
{