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
|
import uuid
|
||||||
|
|
||||||
|
@ -14,8 +14,8 @@ class Migration(migrations.Migration):
|
||||||
initial = True
|
initial = True
|
||||||
|
|
||||||
dependencies = [
|
dependencies = [
|
||||||
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
|
||||||
("authentik_flows", "0027_auto_20231028_1424"),
|
("authentik_flows", "0027_auto_20231028_1424"),
|
||||||
|
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
|
||||||
]
|
]
|
||||||
|
|
||||||
operations = [
|
operations = [
|
||||||
|
@ -127,17 +127,15 @@ class Migration(migrations.Migration):
|
||||||
migrations.CreateModel(
|
migrations.CreateModel(
|
||||||
name="MobileDeviceToken",
|
name="MobileDeviceToken",
|
||||||
fields=[
|
fields=[
|
||||||
(
|
|
||||||
"id",
|
|
||||||
models.AutoField(
|
|
||||||
auto_created=True, primary_key=True, serialize=False, verbose_name="ID"
|
|
||||||
),
|
|
||||||
),
|
|
||||||
(
|
(
|
||||||
"expires",
|
"expires",
|
||||||
models.DateTimeField(default=authentik.core.models.default_token_duration),
|
models.DateTimeField(default=authentik.core.models.default_token_duration),
|
||||||
),
|
),
|
||||||
("expiring", models.BooleanField(default=True)),
|
("expiring", models.BooleanField(default=True)),
|
||||||
|
(
|
||||||
|
"token_uuid",
|
||||||
|
models.UUIDField(default=uuid.uuid4, primary_key=True, serialize=False),
|
||||||
|
),
|
||||||
(
|
(
|
||||||
"token",
|
"token",
|
||||||
models.TextField(
|
models.TextField(
|
||||||
|
|
|
@ -227,6 +227,7 @@ class MobileTransaction(ExpiringModel):
|
||||||
class MobileDeviceToken(ExpiringModel):
|
class MobileDeviceToken(ExpiringModel):
|
||||||
"""Mobile device token"""
|
"""Mobile device token"""
|
||||||
|
|
||||||
|
token_uuid = models.UUIDField(default=uuid4, primary_key=True)
|
||||||
device = models.ForeignKey(MobileDevice, on_delete=models.CASCADE, null=True)
|
device = models.ForeignKey(MobileDevice, on_delete=models.CASCADE, null=True)
|
||||||
user = models.ForeignKey(get_user_model(), on_delete=models.CASCADE)
|
user = models.ForeignKey(get_user_model(), on_delete=models.CASCADE)
|
||||||
token = models.TextField(default=default_token_key)
|
token = models.TextField(default=default_token_key)
|
||||||
|
|
|
@ -5739,8 +5739,8 @@ paths:
|
||||||
tags:
|
tags:
|
||||||
- core
|
- core
|
||||||
security:
|
security:
|
||||||
- authentik: []
|
|
||||||
- mobile_device_token: []
|
- mobile_device_token: []
|
||||||
|
- authentik: []
|
||||||
responses:
|
responses:
|
||||||
'200':
|
'200':
|
||||||
content:
|
content:
|
||||||
|
|
Reference in New Issue