def METHOD_NAME(
    sender, instance: Submission, request: Request, **kwargs
):
    # form_auth has information from an authentication backend, so could be a client or employee
    form_auth = request.session.get(FORM_AUTH_SESSION_KEY)
    # registrator_subject might have additional info about the client entered by an employee
    registrator_subject = request.session.get(REGISTRATOR_SUBJECT_SESSION_KEY)
    if not form_auth:
        if instance.form.login_required:
            raise PermissionDenied(_("You must be logged in to start this form."))
        return
    plugin = form_auth["plugin"]
    attribute = form_auth["attribute"]
    plugin_instance = register[plugin]
    if plugin_instance.is_demo_plugin and not request.user.is_staff:
        logger.warning(
            "Demo plugin '%s' auth flow bypassed, blocking attempt to set identifying "
            "attribute on submission '%s'.",
            plugin,
            instance.uuid,
        )
        raise PermissionDenied(_("Demo plugins require an active admin session."))
    user = request.user if request.user.is_authenticated else None
    logger.debug(
        "Persisting form auth to submission %s. Plugin: '%s' (setting attribute '%s')",
        instance.uuid,
        plugin,
        attribute,
        extra={
            "user_id": user.id if user else None,
            "submission_uuid": instance.uuid,
            "plugin": plugin,
            "attribute": attribute,
        },
    )
    logevent.submission_auth(
        instance,
        delegated=registrator_subject
        and registrator_subject.get("skipped_subject_info") is None,
        user=user,
    )
    if registrator_subject:
        # we got registrator_subject data so form_auth is an employee
        if registrator_subject.get("skipped_subject_info"):
            # If continued without extra details, store the employee details in AuthInfo
            store_auth_details(instance, form_auth)
        else:
            # If KVK/BSN is given, store those details in the AuthInfo model and the employee details in the Registrator model.
            auth_save = {
                "value": registrator_subject["value"],
                "attribute": registrator_subject["attribute"],
                # TODO we don't have a plugin to define here? things break if this doesn't exist (like the logout view)
                "plugin": registrator_subject.get("plugin", "registrator"),
            }
            registrator_save = {
                "value": form_auth["value"],
                "attribute": form_auth["attribute"],
                "plugin": form_auth["plugin"],
            }
            # TODO the "machtigingen" key disappeared
            store_auth_details(instance, auth_save)
            store_registrator_details(instance, registrator_save)
    else:
        store_auth_details(instance, form_auth)