-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Be able to configure the cookie same site #5124
Conversation
from pyramid_multiauth import MultiAuthenticationPolicy | ||
|
||
from c2cgeoportal_geoportal.resources import defaultgroupsfinder | ||
|
||
LOG = logging.getLogger(__name__) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not used...
callback=defaultgroupsfinder, | ||
cookie_name=settings["authtkt_cookie_name"], | ||
samesite=samesite is None if samesite == '' else samesite, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
samesite == '' => samesite is None == False
So it could be simplified to:
False if samesite == '' else samesite
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oups thanks :-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
=> #5127
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But False is not a correct value for samesite:
samesite
Default: 'Lax'. The 'samesite' option of the session cookie. Set the value to None to turn off the samesite option.
So it should be correct and really simpler with:
samesite=samesite or None
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: for boolean settings it would be better to use pyramid.settings.asbool
No description provided.