netadm/authentication/routers/auth.py

41 lines
814 B
Python
Raw Permalink Normal View History

2024-10-02 15:50:50 +00:00
from fastapi import APIRouter
from config import settings
from schemas.user import UserRead, UserCreate
from .user_router_helper import fastapi_users
from authentication.dependencies import authentication_backend
router = APIRouter(
prefix=settings.prefix.auth,
tags=["Аuth"],
)
# /login
# /logout
router.include_router(
router=fastapi_users.get_auth_router(
authentication_backend,
# requires_verification=True,
),
)
# /register
router.include_router(
router=fastapi_users.get_register_router(
UserRead,
UserCreate,
),
)
# /request-verify-token
# /verify
router.include_router(
router=fastapi_users.get_verify_router(UserRead),
)
# /forgot-password
# /reset-password
router.include_router(
router=fastapi_users.get_reset_password_router(),
)