code: def register(self):
          
          form = self._get_form('SECURITY_REGISTER_FORM')
          if form.validate_on_submit():
              user = self.security_service.user_manager.create(**form.to_dict())
              self.security_service.register_user(user)
              return self.redirect('SECURITY_POST_REGISTER_REDIRECT_ENDPOINT')
  
          return self.render('register',
                             register_user_form=form,
                             **self.security.run_ctx_processor('register'))
docs: View function to register user. Supports html and json requests.