How can I redirect /login when user deleted in databases ( use Middleware)

I deleted user in database. I will try $this->redirect([‘controller’ => ‘Users’, ‘action’ => ‘index’]) or return $response->withHeader(‘Location’, ‘/users/login’);
but it 's not working. How can I do now

Since the user-data has been deleted in the database, you can’t check whether the user ‘has been deleted’ when that user is trying to login. All you can do is to know that this user does not exist.

You can just return (redirect) if any user has a failed-login.