# Path: apps/core/models.py
# class EmailAuthToken(models.Model):
#     """
#     denotes single email auth token for an user
#     - tokenid:     unique token id
#     - user:        user object
#     - expire_time: expire time; < 24 hours
#     """
#     tokenid = models.CharField(max_length=48, primary_key=True)
#     user = models.ForeignKey(User, on_delete=models.CASCADE)
#     expire_time = models.DateTimeField()
# 
#     def __str__(self):
#         return f'{self.user} - {self.tokenid}'
# 
# class ResetPWToken(models.Model):
#     """
#     denotes single password reset token for an user
#     - tokenid:     unique token id
#     - user:        user object
#     - expire_time: expire time; < 24 hours
#     """
#     tokenid = models.CharField(max_length=48, primary_key=True)
#     user = models.ForeignKey(User, on_delete=models.CASCADE)
#     expire_time = models.DateTimeField()
# 
#     def __str__(self):
#         return f'{self.user} - {self.tokenid}'


import datetime
from secrets import token_hex
from django.conf import settings
from django.core.mail import send_mail
from django.utils import timezone
from apps.core.models import EmailAuthToken, ResetPWToken




RESET_PW_MSG_TITLE = '[SPARCS SSO] 비밀번호 재설정 / Reset Password'
RESET_PW_MSG_BODY = (
    '<h3>SPARCS SSO 비밀번호 재설정 안내</h3>'
    '<p>안녕하세요, {name}님</p>'
    '<p>SPARCS SSO 계정에 대한 비밀번호 재설정 요청이 있었습니다.</p>'
    '<p>다음 링크를 클릭하거나 주소창에 붙여 넣어 비밀번호를 재설정할 수 있습니다.</p>'

# Path: apps/core/models.py
# class EmailAuthToken(models.Model):
#     """
#     denotes single email auth token for an user
#     - tokenid:     unique token id
#     - user:        user object
#     - expire_time: expire time; < 24 hours
#     """
#     tokenid = models.CharField(max_length=48, primary_key=True)
#     user = models.ForeignKey(User, on_delete=models.CASCADE)
#     expire_time = models.DateTimeField()
# 
#     def __str__(self):
#         return f'{self.user} - {self.tokenid}'
# 
# class ResetPWToken(models.Model):
#     """
#     denotes single password reset token for an user
#     - tokenid:     unique token id
#     - user:        user object
#     - expire_time: expire time; < 24 hours
#     """
#     tokenid = models.CharField(max_length=48, primary_key=True)
#     user = models.ForeignKey(User, on_delete=models.CASCADE)
#     expire_time = models.DateTimeField()
# 
#     def __str__(self):
#         return f'{self.user} - {self.tokenid}'


# Path: apps/core/backends/token.py
import datetime
from secrets import token_hex
from django.conf import settings
from django.core.mail import send_mail
from django.utils import timezone
from apps.core.models import EmailAuthToken, ResetPWToken





RESET_PW_MSG_TITLE = '[SPARCS SSO] 비밀번호 재설정 / Reset Password'
RESET_PW_MSG_BODY = (
    '<h3>SPARCS SSO 비밀번호 재설정 안내</h3>'
    '<p>안녕하세요, {name}님</p>'
    '<p>SPARCS SSO 계정에 대한 비밀번호 재설정 요청이 있었습니다.</p>'
    '<p>다음 링크를 클릭하거나 주소창에 붙여 넣어 비밀번호를 재설정할 수 있습니다.</p>'

    '<p><a href="{link}">{link}</a></p>'