mirror of
https://github.com/khoaliber/khoj.git
synced 2026-03-09 05:39:12 +00:00
Decrease timeout limit for verification codes to 5 minutes
This commit is contained in:
@@ -240,7 +240,7 @@ async def aget_or_create_user_by_email(email: str) -> tuple[KhojUser, bool]:
|
|||||||
if user:
|
if user:
|
||||||
# Generate a secure 6-digit numeric code
|
# Generate a secure 6-digit numeric code
|
||||||
user.email_verification_code = f"{secrets.randbelow(1000000):06}"
|
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()
|
await user.asave()
|
||||||
|
|
||||||
user_subscription = await Subscription.objects.filter(user=user).afirst()
|
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;">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>
|
<h1 style="font-size: 24px; color: #2c3e50; margin-bottom: 20px; text-align: center;">{{ code }}</h1>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user