Fixed the login with an additional variable. It now registers the correct user and user type.