Have a look at the forgot password module https://marketplace.mendix.com/link/component/1296/Mendix/Forgot-Password-module this contains the sign-up function as you describe (next to the forgot password feature)
So you can either implement this module or look at the implementation to see how this can be done.