Skip to content

Commit

Permalink
feat: decrease expiry time for access tokens (anitab-org#1039)
Browse files Browse the repository at this point in the history
Co-authored-by: Isabel Costa <11148726+isabelcosta@users.noreply.github.com>
  • Loading branch information
HeroicHitesh and isabelcosta authored Nov 20, 2021
1 parent 94daff8 commit 8977489
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion config.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class BaseConfig(object):
UNVERIFIED_USER_THRESHOLD = 2592000 # 30 days

# Flask JWT settings
JWT_ACCESS_TOKEN_EXPIRES = timedelta(weeks=1)
JWT_ACCESS_TOKEN_EXPIRES = timedelta(minutes=10)
JWT_REFRESH_TOKEN_EXPIRES = timedelta(weeks=4)

# Security
Expand Down
10 changes: 5 additions & 5 deletions tests/test_app_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def test_app_testing_config(self):

# testing JWT configurations
self.assertEqual(
timedelta(weeks=1), application.config["JWT_ACCESS_TOKEN_EXPIRES"]
timedelta(minutes=10), application.config["JWT_ACCESS_TOKEN_EXPIRES"]
)
self.assertEqual(
timedelta(weeks=4), application.config["JWT_REFRESH_TOKEN_EXPIRES"]
Expand Down Expand Up @@ -69,7 +69,7 @@ def test_app_development_config(self):

# testing JWT configurations
self.assertEqual(
timedelta(weeks=1), application.config["JWT_ACCESS_TOKEN_EXPIRES"]
timedelta(minutes=10), application.config["JWT_ACCESS_TOKEN_EXPIRES"]
)


Expand All @@ -94,7 +94,7 @@ def test_app_development_config(self):

# testing JWT configurations
self.assertEqual(
timedelta(weeks=1), application.config["JWT_ACCESS_TOKEN_EXPIRES"]
timedelta(minutes=10), application.config["JWT_ACCESS_TOKEN_EXPIRES"]
)


Expand All @@ -120,7 +120,7 @@ def test_app_development_config(self):

# testing JWT configurations
self.assertEqual(
timedelta(weeks=1), application.config["JWT_ACCESS_TOKEN_EXPIRES"]
timedelta(minutes=10), application.config["JWT_ACCESS_TOKEN_EXPIRES"]
)
self.assertEqual(
timedelta(weeks=4), application.config["JWT_REFRESH_TOKEN_EXPIRES"]
Expand Down Expand Up @@ -148,7 +148,7 @@ def test_app_production_config(self):

# testing JWT configurations
self.assertEqual(
timedelta(weeks=1), application.config["JWT_ACCESS_TOKEN_EXPIRES"]
timedelta(minutes=10), application.config["JWT_ACCESS_TOKEN_EXPIRES"]
)
self.assertEqual(
timedelta(weeks=4), application.config["JWT_REFRESH_TOKEN_EXPIRES"]
Expand Down

0 comments on commit 8977489

Please sign in to comment.