fix(auth): resolve demo login redirect loop, fix backend API bugs, restore clean login UI, and add comprehensive API docs with headers

This commit is contained in:
2026-09-04 11:49:13 +05:30
parent b152f73c3d
commit 3ad281aae6
8 changed files with 1299 additions and 52 deletions

View File

@@ -5,6 +5,9 @@ import os
from database import engine, init_db
import models
import bcrypt
DEFAULT_SEED_HASH = bcrypt.hashpw("Password123!".encode('utf-8'), bcrypt.gensalt()).decode('utf-8')
def seed_local_database():
# Ensure tables are created
@@ -31,7 +34,7 @@ def seed_local_database():
id=free_student_id,
phone="8888888888",
email="free@pragativeer.com",
password_hash="mock_hash",
password_hash=DEFAULT_SEED_HASH,
name="Amit Kumar (Free Tier)",
student_class=models.ClassEnum.TWELFTH,
medium=models.MediumEnum.ENGLISH,
@@ -49,7 +52,7 @@ def seed_local_database():
id=pro_student_id,
phone="7777777777",
email="pro@pragativeer.com",
password_hash="mock_hash",
password_hash=DEFAULT_SEED_HASH,
name="Priya Singh (Pro Tier)",
student_class=models.ClassEnum.TWELFTH,
medium=models.MediumEnum.ENGLISH,
@@ -68,7 +71,7 @@ def seed_local_database():
id=neha_id,
phone="6666666666",
email="neha@pragativeer.com",
password_hash="mock_hash",
password_hash=DEFAULT_SEED_HASH,
name="Neha Verma",
student_class=models.ClassEnum.TWELFTH,
medium=models.MediumEnum.ENGLISH,
@@ -117,7 +120,7 @@ def seed_local_database():
id=student_id,
phone="9999999999",
email="student@pragativeer.com",
password_hash="mock_hash",
password_hash=DEFAULT_SEED_HASH,
name="Rahul Sharma (AI Coach Tier)",
student_class=models.ClassEnum.TWELFTH,
medium=models.MediumEnum.ENGLISH,