feat: redirect to referer on logout if possible
This commit is contained in:
parent
6db3aba1c2
commit
c5a4ac37b2
@ -72,6 +72,13 @@ public sealed class AdminController : ControllerBase
|
|||||||
_sessionService.DeleteSession(session);
|
_sessionService.DeleteSession(session);
|
||||||
}
|
}
|
||||||
|
|
||||||
return _sessionService.DeleteSessionCookie(Response);
|
_sessionService.DeleteSessionCookie(Response);
|
||||||
|
|
||||||
|
if (Request.Headers.Referer is var referer && !string.IsNullOrWhiteSpace(referer.ToString()))
|
||||||
|
{
|
||||||
|
return Redirect(referer!);
|
||||||
|
}
|
||||||
|
|
||||||
|
return RedirectToPage("/admin/login");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user