Middleware redirect not working! Authentication plugin

so here i am just following the official docs example to custom redirect handler with flash message middleware but its not working, It does not redirect user when user have not authorized to particular controller/action

this is custom middleware and i had attached into application.php in authorization middleware