Skip to content

Commit 7357f14

Browse files
author
Ankur Srivastava
committed
added jwt expiry
1 parent cfd9bba commit 7357f14

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

backend/flask_app/config.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import logging
44
import os
5-
5+
from datetime import timedelta
66
CONFIG = {
77
"development": "flask_app.config.DevelopmentConfig",
88
"testing": "flask_app.config.TestingConfig",
@@ -34,9 +34,10 @@ class BaseConfig(object):
3434
COMPRESS_LEVEL = 6
3535
COMPRESS_MIN_SIZE = 500
3636

37-
# Change it based on your admin user
37+
# Change it based on your admin user, should ideally read from DB.
3838
ADMIN_USER = 'admin'
3939
ADMIN_PASSWORD = 'admin'
40+
JWT_EXPIRES = timedelta(minutes=10)
4041

4142

4243
class DevelopmentConfig(BaseConfig):
@@ -47,6 +48,7 @@ class DevelopmentConfig(BaseConfig):
4748
BASEDIR = os.path.abspath(os.path.dirname(__file__))
4849
SQLALCHEMY_DATABASE_URI = 'sqlite:///' + os.path.join(BASEDIR, 'app.db')
4950
SECRET_KEY = 'not-so-super-secret'
51+
JWT_SECRET_KEY = 'another_super_awesome_secret_stuff_yo.'
5052

5153

5254
class ProductionConfig(BaseConfig):
@@ -57,6 +59,7 @@ class ProductionConfig(BaseConfig):
5759
BASEDIR = os.path.abspath(os.path.dirname(__file__))
5860
SQLALCHEMY_DATABASE_URI = 'sqlite:///' + os.path.join(BASEDIR, 'app.db')
5961
SECRET_KEY = 'Super-awesome-secret-stuff'
62+
JWT_SECRET_KEY = 'another_super_awesome_secret_stuff_yo.'
6063

6164

6265
class TestingConfig(BaseConfig):
@@ -66,3 +69,4 @@ class TestingConfig(BaseConfig):
6669
TESTING = True
6770
SQLALCHEMY_DATABASE_URI = 'sqlite://'
6871
SECRET_KEY = '792842bc-c4df-4de1-9177-d5207bd9faa6'
72+
JWT_SECRET_KEY = 'another_super_awesome_secret_stuff_yo.'

0 commit comments

Comments
 (0)