2020-04-15 20:19:03 +00:00
|
|
|
from django.db.models import Model, ForeignKey, CharField, DateTimeField, UUIDField, CASCADE
|
|
|
|
from django.contrib.auth import get_user_model
|
|
|
|
|
|
|
|
from uuid import uuid4
|
|
|
|
|
|
|
|
class OTPUser(Model):
|
|
|
|
user = ForeignKey(get_user_model(), CASCADE)
|
|
|
|
provider = CharField(max_length=255)
|
|
|
|
|
|
|
|
class LoginSession(Model):
|
|
|
|
uuid = UUIDField(default=uuid4, primary_key=True)
|
|
|
|
user = ForeignKey(get_user_model(), CASCADE)
|
2020-04-18 13:02:41 +00:00
|
|
|
creation = DateTimeField(auto_now_add=True)
|
|
|
|
|
|
|
|
class PWResetToken(Model):
|
|
|
|
token = UUIDField(default=uuid4, primary_key=True)
|
|
|
|
user = ForeignKey(get_user_model(), CASCADE)
|
2020-04-15 20:19:03 +00:00
|
|
|
creation = DateTimeField(auto_now_add=True)
|