How to assign member role directly after signup is complete in code?

Did you manage to figure it out? I am wondering the same thing. Could you please post your solution?