diff --git a/news/41.feature b/news/41.feature new file mode 100644 index 0000000..12939df --- /dev/null +++ b/news/41.feature @@ -0,0 +1,2 @@ +Login the user in portal_membership +[erral] diff --git a/src/pas/plugins/oidc/plugins.py b/src/pas/plugins/oidc/plugins.py index a1a2c3c..0a5ca25 100644 --- a/src/pas/plugins/oidc/plugins.py +++ b/src/pas/plugins/oidc/plugins.py @@ -17,6 +17,7 @@ from secrets import choice from typing import List from ZODB.POSException import ConflictError +from zope.globalrequest import getRequest from zope.interface import implementer from zope.interface import Interface @@ -229,6 +230,9 @@ def rememberIdentity(self, userinfo): if user and self.getProperty("create_restapi_ticket"): self._setupJWTTicket(user_id, user) + mtool = api.portal.get_tool("portal_membership") + mtool.loginUser(getRequest()) + def _updateUserProperties(self, user, userinfo): """Update the given user properties from the set of credentials. This is utilised when first creating a user, and to update