mirror of
https://github.com/discourse/discourse.git
synced 2025-06-04 19:57:18 +08:00
FEATURE: add support for same site cookies
Defaults to Lax, can be disabled or set to Strict. Strict will only work if you require login and use SSO. Otherwise when clicking on links to your site you will appear logged out till you refresh the page.
This commit is contained in:
@ -162,12 +162,18 @@ class Auth::DefaultCurrentUserProvider
|
||||
end
|
||||
|
||||
def cookie_hash(unhashed_auth_token)
|
||||
{
|
||||
hash = {
|
||||
value: unhashed_auth_token,
|
||||
httponly: true,
|
||||
expires: SiteSetting.maximum_session_age.hours.from_now,
|
||||
secure: SiteSetting.force_https
|
||||
}
|
||||
|
||||
if SiteSetting.same_site_cookies != "Disabled"
|
||||
hash[:same_site] = SiteSetting.same_site_cookies
|
||||
end
|
||||
|
||||
hash
|
||||
end
|
||||
|
||||
def make_developer_admin(user)
|
||||
|
Reference in New Issue
Block a user