I had this same issue. What I did is add one more code to render the user id again.
User u = new User(); u.lastname= 'blabla'; u.ContactId = currentContact.Id; u.email='[email protected]'; ... ... ... system.setPassword(u.Id, 'password123');
User uu =[select id from user where email='[email protected]'];
return uu.id;
User u = new User();
u.lastname= 'blabla';
u.ContactId = currentContact.Id;
u.email='[email protected]';
...
...
...
system.setPassword(u.Id, 'password123');
User uu =[select id from user where email='[email protected]'];
return uu.id;