add(portal): new cookie attribute SameSite=Lax#653
Conversation
654f9e2 to
7792981
Compare
| form_end = '</form>' | ||
| error_msg = error or "" | ||
|
|
||
| return render_to_response("portal_%s_html_registration.conf" % (str(application.template.id)), |
There was a problem hiding this comment.
This is dead code anyway.
| form_end = '</form>' | ||
| error_msg = error or "" | ||
|
|
||
| return render_to_response("portal_%s_html_registration.conf" % (str(application.template.id)), |
There was a problem hiding this comment.
This is dead code anyway.
| # Needed for Safari and mobiles support | ||
| response['Content-Length'] = 0 | ||
| response.set_cookie(portal_cookie_name, portal_cookie, domain=split_domain(fqdn), httponly=True, secure=scheme=="https") | ||
| set_portal_cookie(response, portal_cookie_name, portal_cookie, f"{scheme}://{fqdn}") |
There was a problem hiding this comment.
Regression tested by :
https://github.com/VultureProject/vulture-gui/blob/779298154fd74854a67df80a624c0ddaf122c53c/vulture_os/portal/tests/test_authentication.py#L163-169
https://github.com/VultureProject/vulture-gui/pull/653/changes#diff-f8e09b9065d6532b96d8af13fcedf56272cef7b489a0e348a62d0e87d9b4bc42R163
| response.set_cookie(portal_cookie_name, self.redis_portal_session.key, | ||
| domain=self.get_redirect_url_domain(), httponly=True, | ||
| secure=self.get_redirect_url().startswith('https')) | ||
| set_portal_cookie(response, portal_cookie_name, self.redis_portal_session.key, self.get_redirect_url()) |
There was a problem hiding this comment.
Regression tested by :
https://github.com/VultureProject/vulture-gui/blob/779298154fd74854a67df80a624c0ddaf122c53c/vulture_os/portal/tests/test_authentication.py#L163-169
https://github.com/VultureProject/vulture-gui/pull/653/changes#diff-f8e09b9065d6532b96d8af13fcedf56272cef7b489a0e348a62d0e87d9b4bc42R163
7792981 to
4917f5b
Compare
4917f5b to
8d377e1
Compare
Added