Skip to content

Commit

Permalink
feat: add invalidate current user pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
andrey-canon committed Oct 27, 2023
1 parent 6f833fd commit 1a6eaee
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,26 @@ def social_details(backend, details, response, *args, **kwargs):
details["details"][key] = response.get(value)

return details


def invalidate_current_user(user=None, *args, **kwargs):
"""This pipeline sets to None the current user in order to avoid invalid associations.
This was implemented due to an unexpected behavior when a user is logged and a different
user tries to authenticate by using a SAML IDP in the same browser, the result is that
instead of having two different accounts the second user is associated to the first user's
account, this behavior is the result of SESSION_COOKIE_SAMESITE = "None" however the
possible fix, SESSION_COOKIE_SAMESITE = "Lax", has not been tested in the whole platform
therefore that can not be implemented yet.
**NOTE**
* This MUST be the first pipeline.
* This just has been tested in the NELP environment where the linked accounts feature
was deactivated.
"""
if user:
return {
"user": None
}

return {}

0 comments on commit 1a6eaee

Please sign in to comment.