kumidc/authentication/migrations/0001_initial.py
2022-08-04 13:15:10 +02:00

37 lines
1.2 KiB
Python

# Generated by Django 3.2.14 on 2022-08-02 16:31
import authentication.helpers.session
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import pyotp
import uuid
class Migration(migrations.Migration):
initial = True
dependencies = [
('core', '0001_initial'),
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.CreateModel(
name='TOTPSecret',
fields=[
('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, primary_key=True, serialize=False, to='core.user')),
('secret', models.CharField(default=pyotp.random_base32, max_length=32)),
('active', models.BooleanField(default=False)),
],
),
migrations.CreateModel(
name='AuthSession',
fields=[
('id', models.UUIDField(default=uuid.uuid4, primary_key=True, serialize=False)),
('expiry', models.DateTimeField(default=authentication.helpers.session.session_expiry)),
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
],
),
]