use uuid for mobile token
Signed-off-by: Jens Langhammer <jens@goauthentik.io>
This commit is contained in:
parent
91d025e7f2
commit
ac6fc38488
|
@ -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(
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -5739,8 +5739,8 @@ paths:
|
|||
tags:
|
||||
- core
|
||||
security:
|
||||
- authentik: []
|
||||
- mobile_device_token: []
|
||||
- authentik: []
|
||||
responses:
|
||||
'200':
|
||||
content:
|
||||
|
|
Reference in New Issue