Refactor code

This commit is contained in:
2022-07-22 14:28:44 +02:00
parent 07542abf8b
commit 24240ca4fd
3 changed files with 13 additions and 10 deletions

View File

@ -137,6 +137,9 @@ impl<S, B> Service<ServiceRequest> for AuthInnerMiddleware<S>
&& (req.path().starts_with(ADMIN_ROUTES)
|| req.path().starts_with(AUTHENTICATED_ROUTES) || req.path().eq(AUTHORIZE_URI))
{
log::debug!("Redirect unauthenticated user from {} to authorization route.",
req.path());
let path = req.uri().to_string();
return Ok(req
.into_response(redirect_user_for_login(path))