From 8a5e83eea32de39fe089bd4ccf217f65dace303d Mon Sep 17 00:00:00 2001 From: Ryan Luker Date: Fri, 31 Mar 2023 15:08:31 -0700 Subject: [PATCH] Allow empty jti uuids --- oauth2_provider/migrations/0006_auto_20230330_1837.py | 2 +- oauth2_provider/models.py | 6 +++++- setup.cfg | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/oauth2_provider/migrations/0006_auto_20230330_1837.py b/oauth2_provider/migrations/0006_auto_20230330_1837.py index ce6aa367e..14de06392 100644 --- a/oauth2_provider/migrations/0006_auto_20230330_1837.py +++ b/oauth2_provider/migrations/0006_auto_20230330_1837.py @@ -14,7 +14,7 @@ class Migration(migrations.Migration): migrations.AddField( model_name='idtoken', name='jti', - field=models.UUIDField(default=uuid.uuid4, editable=False, unique=True), + field=models.UUIDField(blank=True, null=True), ), migrations.AlterField( model_name='application', diff --git a/oauth2_provider/models.py b/oauth2_provider/models.py index ee1463569..fc5e0330d 100644 --- a/oauth2_provider/models.py +++ b/oauth2_provider/models.py @@ -507,7 +507,11 @@ class AbstractIDToken(models.Model): related_name="%(app_label)s_%(class)s", ) token = models.TextField(unique=True) - jti = models.UUIDField(unique=True, default=uuid.uuid4, editable=False, verbose_name="JWT Token ID") + jti = models.UUIDField( + blank=True, + null=True, + verbose_name="JWT Token ID" + ) application = models.ForeignKey( oauth2_settings.APPLICATION_MODEL, on_delete=models.CASCADE, diff --git a/setup.cfg b/setup.cfg index 13d6cd0f9..551d60960 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = django-oauth-toolkit -version = 1.5.0 +version = 1.5.1 description = OAuth2 Provider for Django long_description = file: README.rst long_description_content_type = text/x-rst