mirror of
https://github.com/BinaryAlley/Nemera.git
synced 2026-12-03 16:11:10 +00:00
Redirects stale authenticated sessions to login instead of the not-found page
This commit is contained in:
1 parent
300ed73f8a
commit
6a006ef945
4 files changed
+34
-9
No files matched your search
@@ -69,7 +69,7 @@ public class CachedAuthorizationHandler : DelegatingHandler
|
||||
);
|
||||
// if the API returned 401 Unauthorized (i.e. token expired), DO NOT cache this response - it will be used for authorization endpoints even after successful login,
|
||||
// resulting in incorrect login redirection cycles!
|
||||
if (response.StatusCode == HttpStatusCode.Unauthorized)
|
||||
if (response.StatusCode is HttpStatusCode.Unauthorized or HttpStatusCode.NotFound)
|
||||
await _hybridCache.RemoveAsync(AUTHORIZATION_ENDPOINT, cancellationToken).ConfigureAwait(false);
|
||||
return new HttpResponseMessage(response.StatusCode)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user