From 1f6ca8b72730a257a688f5db0c373294aa6685f8 Mon Sep 17 00:00:00 2001 From: burnettk Date: Mon, 3 Jun 2024 13:04:28 -0400 Subject: [PATCH] allow local test tokens to last 24 hours --- spiffworkflow-backend/src/spiffworkflow_backend/models/user.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/spiffworkflow-backend/src/spiffworkflow_backend/models/user.py b/spiffworkflow-backend/src/spiffworkflow_backend/models/user.py index b711867e..b600df7b 100644 --- a/spiffworkflow-backend/src/spiffworkflow_backend/models/user.py +++ b/spiffworkflow-backend/src/spiffworkflow_backend/models/user.py @@ -69,6 +69,7 @@ class UserModel(SpiffworkflowBaseDBModel): if secret_key is None: raise KeyError("we need current_app.config to have a SECRET_KEY") + one_day_in_seconds = 86400 # hours = float(app.config['TOKEN_AUTH_TTL_HOURS']) base_payload = { "email": self.email, @@ -76,7 +77,7 @@ class UserModel(SpiffworkflowBaseDBModel): "sub": f"service:{self.service}::service_id:{self.service_id}", "iss": self.__class__.spiff_generated_jwt_issuer(), "iat": math.floor(time.time()), - "exp": round(time.time()) + 3600, + "exp": round(time.time()) + one_day_in_seconds, "aud": SPIFF_GENERATED_JWT_AUDIENCE, }