Commit d9aa24ad authored by Vincent Pelletier's avatar Vincent Pelletier

erp5_core: Call PAS logout method for PAS-authenticated users.

parent 9d32ef3a
from AccessControl import getSecurityManager
portal = context.getPortalObject()
username = getSecurityManager().getUser().getId()
user = getSecurityManager().getUser()
username = user.getId()
if username is not None:
portal.portal_sessions.manage_delObjects(
portal.Base_getAutoLogoutSessionKey(
......@@ -18,4 +19,14 @@ if getattr(portal.portal_skins, "erp5_oauth_google_login", None):
if getattr(portal.portal_skins, "erp5_oauth_facebook_login", None):
REQUEST.RESPONSE.expireCookie('__ac_facebook_hash', path='/')
# PAS logout, if user is from a PAS user folder (which is the acquisition parent of the user)
getattr(
user,
'resetCredentials',
lambda **kw: None,
)(
request=REQUEST,
response=REQUEST.RESPONSE,
)
return REQUEST.RESPONSE.redirect(REQUEST.URL1 + '/logged_out')
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment