diff --git a/ereuse_devicehub/config.py b/ereuse_devicehub/config.py index 630a5ffb..16d2005a 100644 --- a/ereuse_devicehub/config.py +++ b/ereuse_devicehub/config.py @@ -97,3 +97,9 @@ class DevicehubConfig(Config): MAIL_DEFAULT_SENDER = config('MAIL_DEFAULT_SENDER', '') API_DLT = config('API_DLT', None) API_DLT_TOKEN = config('API_DLT_TOKEN', None) + + """Definition of oauth jwt details.""" + OAUTH2_JWT_ENABLED = config('OAUTH2_JWT_ENABLED', False) + OAUTH2_JWT_ISS = config('OAUTH2_JWT_ISS', '') + OAUTH2_JWT_KEY = config('OAUTH2_JWT_KEY', None) + OAUTH2_JWT_ALG = config('OAUTH2_JWT_ALG', 'HS256') diff --git a/ereuse_devicehub/resources/user/models.py b/ereuse_devicehub/resources/user/models.py index 2805e42a..75a598b1 100644 --- a/ereuse_devicehub/resources/user/models.py +++ b/ereuse_devicehub/resources/user/models.py @@ -41,6 +41,9 @@ class User(UserMixin, Thing): # todo set restriction that user has, at least, one active db + def get_user_id(self): + return self.id + def __init__( self, email, password=None, inventories=None, active=True, phantom=False ) -> None: