Login page is not open after custom rule error

I am checking the user is active or not.
This is my rule code:

function (user, context, callback) {
if (!user.user_metadata.is_Active) {
return callback(new UnauthorizedError(‘User is not active.’));
callback(null, user, context);

after login, it redirects me to this page, and got the error message.

but when I click on the login button it will redirect me to the same page. Login page is not open.