mirror of
https://github.com/khoj-ai/khoj.git
synced 2024-12-19 10:57:45 +00:00
Decrease timeout limit for verification codes to 5 minutes
This commit is contained in:
parent
5d3da3340f
commit
b7783357fa
2 changed files with 2 additions and 2 deletions
|
@ -240,7 +240,7 @@ async def aget_or_create_user_by_email(email: str) -> tuple[KhojUser, bool]:
|
|||
if user:
|
||||
# Generate a secure 6-digit numeric code
|
||||
user.email_verification_code = f"{secrets.randbelow(1000000):06}"
|
||||
user.email_verification_code_expiry = datetime.now(tz=timezone.utc) + timedelta(minutes=30)
|
||||
user.email_verification_code_expiry = datetime.now(tz=timezone.utc) + timedelta(minutes=5)
|
||||
await user.asave()
|
||||
|
||||
user_subscription = await Subscription.objects.filter(user=user).afirst()
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
|
||||
<p style="font-size: 16px; color: #333; margin-bottom: 20px;">Hi!</p>
|
||||
|
||||
<p style="font-size: 16px; color: #333; margin-bottom: 20px;">Use this code (valid for 30 minutes) to login to Khoj:</p>
|
||||
<p style="font-size: 16px; color: #333; margin-bottom: 20px;">Use this code (valid for 5 minutes) to login to Khoj:</p>
|
||||
|
||||
<h1 style="font-size: 24px; color: #2c3e50; margin-bottom: 20px; text-align: center;">{{ code }}</h1>
|
||||
|
||||
|
|
Loading…
Reference in a new issue