init commit

This commit is contained in:
2025-07-14 18:32:55 +03:00
commit e54e57ca3d
25 changed files with 981 additions and 0 deletions

View File

@ -0,0 +1,30 @@
import uuid
from typing import Optional
from fastapi import Request
from fastapi_users import UUIDIDMixin, BaseUserManager
from fastapi_users.jwt import SecretType
from src.database.user import User
SECRET: SecretType
class UserManager(UUIDIDMixin, BaseUserManager[User, uuid.UUID]):
def __init__(self, secret: SecretType):
super().__init__()
reset_password_token_secret = SECRET
verification_token_secret = SECRET
async def on_after_register(self, user: User, request: Optional[Request] = None):
print(f"User {user.id} has registered.")
async def on_after_forgot_password(
self, user: User, token: str, request: Optional[Request] = None
):
print(f"User {user.id} has forgot their password. Reset token: {token}")
async def on_after_request_verify(
self, user: User, token: str, request: Optional[Request] = None
):
print(f"Verification requested for user {user.id}. Verification token: {token}")