mirror of
https://github.com/maxdorninger/MediaManager.git
synced 2026-04-20 21:05:20 +02:00
prevent infinite recursion of autoLogoutMiddleware
This commit is contained in:
@@ -21,7 +21,8 @@ export const loggingMiddleware: Middleware = {
|
||||
|
||||
export const autoLogoutMiddleware: Middleware = {
|
||||
async onResponse({ request, response }) {
|
||||
if (response.status === 401) {
|
||||
if (response.status === 401 && !request.url.endsWith('/auth/cookie/logout')) {
|
||||
|
||||
console.log(`Request to ${request.url} returned HTTP Error Code 401, logging out...`);
|
||||
await handleLogout();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user