From da9d120713fc95a9524cfe4638ba17413fcacd38 Mon Sep 17 00:00:00 2001 From: Andrew Dryga Date: Mon, 26 Jun 2023 13:21:06 -0600 Subject: [PATCH] Do not expire encoded Gateway/Relay tokens --- elixir/apps/domain/lib/domain/gateways.ex | 3 ++- elixir/apps/domain/lib/domain/relays.ex | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/elixir/apps/domain/lib/domain/gateways.ex b/elixir/apps/domain/lib/domain/gateways.ex index a5e81422f..4a01aca51 100644 --- a/elixir/apps/domain/lib/domain/gateways.ex +++ b/elixir/apps/domain/lib/domain/gateways.ex @@ -212,7 +212,8 @@ defmodule Domain.Gateways do key_base = Keyword.fetch!(config, :key_base) salt = Keyword.fetch!(config, :salt) - with {:ok, {id, secret}} <- Plug.Crypto.verify(key_base, salt, encrypted_secret), + with {:ok, {id, secret}} <- + Plug.Crypto.verify(key_base, salt, encrypted_secret, max_age: :infinity), {:ok, token} <- use_token_by_id_and_secret(id, secret) do {:ok, token} else diff --git a/elixir/apps/domain/lib/domain/relays.ex b/elixir/apps/domain/lib/domain/relays.ex index c34c7c9c7..7e924553c 100644 --- a/elixir/apps/domain/lib/domain/relays.ex +++ b/elixir/apps/domain/lib/domain/relays.ex @@ -216,7 +216,8 @@ defmodule Domain.Relays do key_base = Keyword.fetch!(config, :key_base) salt = Keyword.fetch!(config, :salt) - with {:ok, {id, secret}} <- Plug.Crypto.verify(key_base, salt, encrypted_secret), + with {:ok, {id, secret}} <- + Plug.Crypto.verify(key_base, salt, encrypted_secret, max_age: :infinity), {:ok, token} <- use_token_by_id_and_secret(id, secret) do {:ok, token} else