Last active
April 23, 2020 20:58
-
-
Save oreoshake/cfcbd21ad1115f636b2fffca8734bbe0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if current_user&.samesite_lax_enabled? | |
SecureHeaders.use_secure_headers_override(request, :samesite_lax) | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SecureHeaders::Configuration.default do |config| | |
config.cookies = { | |
samesite: { | |
none: { only: ["saml_csrf_token", "saml_return_to"] }, | |
} | |
} | |
end | |
SecureHeaders::Configuration.override(:samesite_lax) do |config| | |
config.cookies = { | |
samesite: { | |
lax: { except: ["saml_csrf_token", "saml_return_to", "saml_csrf_token_legacy", "saml_return_to_legacy"] }, | |
none: { only: ["saml_csrf_token", "saml_return_to"] } | |
} | |
} | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment