built routes for creation of char

This commit is contained in:
2025-11-03 21:42:39 -06:00
parent 6efd3b3aa8
commit 0c83f8cb1a
6 changed files with 188 additions and 10 deletions

37
app/utils/session_user.py Normal file
View File

@@ -0,0 +1,37 @@
from dataclasses import dataclass
from typing import Optional, cast
@dataclass
class SessionUser:
id: str = ""
registered_on: str = ""
name: str = ""
email: str = ""
email_verified: bool = False
phone: str = ""
phone_verified: bool = False
mfa: bool = False
@property
def is_authenticated(self) -> bool:
return True
@property
def email_verification(self) -> bool:
return self.email_verified
@property
def phone_verification(self) -> bool:
return self.phone_verification
def import_g_session(g_session:dict) -> SessionUser:
u = SessionUser(
id=g_session.get("$id"),
name=g_session.get("name"),
registered_on=g_session.get("registration"),
email=g_session.get("email"),
email_verified=g_session.get("emailVerification")
)
return u