Skip to content

Commit

Permalink
Enable JWT rotation (#50)
Browse files Browse the repository at this point in the history
  • Loading branch information
arturo-seijas authored Apr 5, 2024
1 parent c0a0fe8 commit 9e6719f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
8 changes: 8 additions & 0 deletions app/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
https://docs.djangoproject.com/en/4.2/ref/settings/
"""

import datetime
import json
import os
import urllib
Expand Down Expand Up @@ -147,6 +148,13 @@
],
}

SIMPLE_JWT = {
"ACCESS_TOKEN_LIFETIME": datetime.timedelta(days=1),
"REFRESH_TOKEN_LIFETIME": datetime.timedelta(days=7),
"ROTATE_REFRESH_TOKENS": True,
"SIGNING_KEY": SECRET_KEY,
}

LOGGING = {
"version": 1,
"disable_existing_loggers": False,
Expand Down
8 changes: 8 additions & 0 deletions httprequest_lego_provider/tests/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

# pylint:disable=wildcard-import,unused-wildcard-import

import datetime
import os
import secrets
from pathlib import Path
Expand Down Expand Up @@ -32,3 +33,10 @@
"NAME": os.path.join(BASE_DIR, "db.sqlite3"),
}
}

SIMPLE_JWT = {
"ACCESS_TOKEN_LIFETIME": datetime.timedelta(days=1),
"REFRESH_TOKEN_LIFETIME": datetime.timedelta(days=7),
"ROTATE_REFRESH_TOKENS": True,
"SIGNING_KEY": SECRET_KEY,
}

0 comments on commit 9e6719f

Please sign in to comment.