closed the lean modal when the registration codes are generated

@chrisndodge I have added the close modal code when the registration codes are generated. Kindly review the changes.

Thanks