make the login middleware work