Files
trustme/core/apps/accounts/urls.py
2025-08-05 10:26:39 +05:00

36 lines
1.1 KiB
Python

"""
Accounts app urls
"""
from django.urls import path, include
from rest_framework_simplejwt import views as jwt_views
from .views import (
RegisterView,
ResetPasswordView,
MeView,
ChangePasswordView,
MeCompanyView,
)
from rest_framework.routers import DefaultRouter # type: ignore
router = DefaultRouter()
router.register("auth", RegisterView, basename="auth") # type: ignore
router.register("auth", ResetPasswordView, basename="reset-password") # type: ignore
router.register("auth", MeView, basename="me") # type: ignore
router.register("auth", ChangePasswordView, basename="change-password") # type: ignore
router.register(r"me/companies", MeCompanyView, "me-company") # type: ignore
urlpatterns = [ # type: ignore
path("", include(router.urls)), # type: ignore
path("auth/token/", jwt_views.TokenObtainPairView.as_view(), name="token_obtain_pair"),
path("auth/token/verify/", jwt_views.TokenVerifyView.as_view(), name="token_verify"),
path(
"auth/token/refresh/",
jwt_views.TokenRefreshView.as_view(),
name="token_refresh",
),
]