chore: cookies with "secure" flag (only transmitted through https)

This commit is contained in:
Colin Darie 2024-07-03 11:04:16 +02:00
parent b3ccfc16c4
commit 1eb0bdb4ae
No known key found for this signature in database
GPG key ID: 4FB865FDBCA4BCC4
6 changed files with 10 additions and 7 deletions

View file

@ -8,7 +8,8 @@ module TrustedDeviceConcern
cookies.encrypted[TRUSTED_DEVICE_COOKIE_NAME] = {
value: JSON.generate({ created_at: start_at }),
expires: start_at + TRUSTED_DEVICE_PERIOD,
httponly: true
httponly: true,
secure: Rails.env.production?
}
end