netadm/authentication/routers/auth.py

41 lines
814 B
Python
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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(),
)