Skip to content

Commit 2295ca8

Browse files
[FIX] auth_saml: avoid context propagation when registering 2 accounts
Fix similar to what is done in auth_oauth in odoo/odoo@5280b1f
1 parent 79ef1c9 commit 2295ca8

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

auth_saml/controllers/main.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@
2525
# ----------------------------------------------------------
2626

2727

28+
def clean_context(context):
29+
""" This function take a dictionary and remove each entry with its key starting with 'default_' """
30+
return {k: v for k, v in context.items() if not k.startswith('default_')}
31+
32+
2833
def fragment_to_query_string(func):
2934
@functools.wraps(func)
3035
def wrapper(self, req, **kw):
@@ -174,7 +179,7 @@ def signin(self, req, **kw):
174179
state = simplejson.loads(kw['RelayState'])
175180
provider = state['p']
176181
dbname = state['d']
177-
context = state.get('c', {})
182+
context = clean_context(state.get('c', {}))
178183
registry = registry_get(dbname)
179184
with registry.cursor() as cr:
180185
try:

0 commit comments

Comments
 (0)