Skip to content

User.onLogin() shall be called earlier (BREAKING v3) #1583

@phorward

Description

@phorward

This is a breaking issue as reminder for ViUR4.

#1573 already faced this in v3.8 but it was a breaking and too big change.
Projects requiring #1573 must therefore resolve it like so:

    def onLogin(self, skel):
        # Synchronize user with external system
        if not skel["manualoverride"] and skel["debitor"]:
            ok, _ = conf.main_app.thirdparty.sync_user_skel(skel)
            if ok:
                skel.write(update_relations=False)

                # Is user still active, or meanwhile flagged locked?
                if not self.is_active(skel):
                    session.killSessionByUser(skel["key"])
                    raise errors.Redirect("s/user_locked")

                # FIXME: HOTFIX IN COMBI WITH VIUR3 authenticateUser;
                # SOME ALREADY SET SESSION VALUES MUST BE SET AGAIN...
                session = current.session.get()
                session["user"] = skel.dbEntity

                current.request.get().response.headers[securitykey.SECURITYKEY_STATIC_HEADER] = \
                    session.static_security_key
                current.user.set(self.getCurrentUser())
                # FIXME: ^^^--- UNTIL HERE ---^^^

        # Super-Login
        super().onLogin(skel)

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureNew feature or requestinterface-changesThis PR modifies or adds interfaces that need further discussion and alignment before mergingperformanceThis issue or pull request enhances or criticizes the performance.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions