allow local test tokens to last 24 hours

This commit is contained in:
burnettk 2024-06-03 13:04:28 -04:00
parent ae6f3119bb
commit 1f6ca8b727
No known key found for this signature in database
1 changed files with 2 additions and 1 deletions

View File

@ -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,
}