diff --git a/authentik/stages/authenticator_mobile/migrations/0001_initial.py b/authentik/stages/authenticator_mobile/migrations/0001_initial.py index bfe3bbdba..c12bf8e66 100644 --- a/authentik/stages/authenticator_mobile/migrations/0001_initial.py +++ b/authentik/stages/authenticator_mobile/migrations/0001_initial.py @@ -1,4 +1,4 @@ -# Generated by Django 4.2.7 on 2023-12-15 16:02 +# Generated by Django 4.2.7 on 2023-12-18 11:37 import uuid @@ -14,8 +14,8 @@ class Migration(migrations.Migration): initial = True dependencies = [ - migrations.swappable_dependency(settings.AUTH_USER_MODEL), ("authentik_flows", "0027_auto_20231028_1424"), + migrations.swappable_dependency(settings.AUTH_USER_MODEL), ] operations = [ @@ -127,17 +127,15 @@ class Migration(migrations.Migration): migrations.CreateModel( name="MobileDeviceToken", fields=[ - ( - "id", - models.AutoField( - auto_created=True, primary_key=True, serialize=False, verbose_name="ID" - ), - ), ( "expires", models.DateTimeField(default=authentik.core.models.default_token_duration), ), ("expiring", models.BooleanField(default=True)), + ( + "token_uuid", + models.UUIDField(default=uuid.uuid4, primary_key=True, serialize=False), + ), ( "token", models.TextField( diff --git a/authentik/stages/authenticator_mobile/models.py b/authentik/stages/authenticator_mobile/models.py index 387023072..2b36a977f 100644 --- a/authentik/stages/authenticator_mobile/models.py +++ b/authentik/stages/authenticator_mobile/models.py @@ -227,6 +227,7 @@ class MobileTransaction(ExpiringModel): class MobileDeviceToken(ExpiringModel): """Mobile device token""" + token_uuid = models.UUIDField(default=uuid4, primary_key=True) device = models.ForeignKey(MobileDevice, on_delete=models.CASCADE, null=True) user = models.ForeignKey(get_user_model(), on_delete=models.CASCADE) token = models.TextField(default=default_token_key) diff --git a/schema.yml b/schema.yml index cc29263d4..71de111cb 100644 --- a/schema.yml +++ b/schema.yml @@ -5739,8 +5739,8 @@ paths: tags: - core security: - - authentik: [] - mobile_device_token: [] + - authentik: [] responses: '200': content: