Signup and login middleware