Merge pull request #7863 from blockscout/np-add-sessions-ttl

Add TTL for account sessions
gettext-expirementing
Victor Baranov 1 year ago committed by GitHub
commit 176ebf0885
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      CHANGELOG.md
  2. 3
      apps/block_scout_web/lib/block_scout_web/endpoint.ex
  3. 2
      apps/block_scout_web/lib/block_scout_web/plug/redis_cookie.ex

@ -19,6 +19,7 @@
### Chore
- [#7863](https://github.com/blockscout/blockscout/pull/7863) - Add max_age for account sessions
- [#7841](https://github.com/blockscout/blockscout/pull/7841) - CORS setup for docker-compose config with new frontend
- [#7832](https://github.com/blockscout/blockscout/pull/7832) - API v2: Add block_number to logs
- [#7789](https://github.com/blockscout/blockscout/pull/7789) - Fix test warnings; Fix name of `MICROSERVICE_ETH_BYTECODE_DB_INTERVAL_BETWEEN_LOOKUPS` env variable

@ -67,7 +67,8 @@ defmodule BlockScoutWeb.Endpoint do
signing_salt: "iC2ksJHS",
same_site: "Lax",
http_only: false,
domain: Application.compile_env(:block_scout_web, :cookie_domain)
domain: Application.compile_env(:block_scout_web, :cookie_domain),
max_age: Application.compile_env(:block_scout_web, :session_cookie_ttl)
)
use SpandexPhoenix

@ -192,7 +192,7 @@ defmodule BlockScoutWeb.Plug.RedisCookie do
defp build_rotating_opts(opts, _), do: Map.put(opts, :rotating_options, [])
defp store_to_redis(cookie) do
Redix.command(:redix, ["SET", hash(cookie), 1])
Redix.command(:redix, ["SET", hash(cookie), 1, "EX", Application.get_env(:block_scout_web, :session_cookie_ttl)])
cookie
end

Loading…
Cancel
Save