code: def invitation_accepted(event):
      
      request = getRequest()
      storage = get_storage()
      if event.token_id not in storage:
          return
  
      ws_uid, username = storage[event.token_id]
      storage[event.token_id]
      acl_users = api.portal.get_tool('acl_users')
      acl_users.updateCredentials(
          request,
          request.response,
          username,
          None
      )
      catalog = api.portal.get_tool(name="portal_catalog")
      brain = catalog.unrestrictedSearchResults(UID=ws_uid)[0]
      with api.env.adopt_roles(["Manager"]):
          ws = IWorkspace(brain.getObject())
          for name in ws.members:
              member = api.user.get(username=name)
              if member is not None:
                  if member.getUserName() == username:
                      api.portal.show_message(
                          _('Oh boy, oh boy, you are already a member'),
                          request,
                      )
                      break
          else:
              ws.add_to_team(user=username)
              api.portal.show_message(
                  _('Welcome to our family, Stranger'),
                  request,
              )
docs: When an invitation is accepted, add the user to the team