from rest_framework.routers import DefaultRouter
from django.urls import include
from django.urls import path
from users.views import UserModelViewSet
from rest_framework_simplejwt.views import TokenObtainPairView
from rest_framework_simplejwt.views import TokenRefreshView
from .views import PasswordReset, UserPasswordResetConfirmView, RegisterViewSet, login, logout, register, \
    register_success, account, changeEmail, changeName, changePassword, resetPassword, resetPasswordConfirm,ResetPassword, \
    ResetPasswordConfirm


router = DefaultRouter(trailing_slash=False)
router.register("items", UserModelViewSet)
# router.register("register", RegisterViewSet, basename="pyk")

urlpatterns = [
    path("", include(router.urls)),
    path('login', login, name='login'),
    path('logout', logout, name='logout'),
    path('register/success', register_success, name='register_success'),
    path('register', register, name='register'),
    path('api/token', TokenObtainPairView.as_view(), name='token_obtain_pair'),
    path('api/token/refresh', TokenRefreshView.as_view(), name='token_refresh'),
    #path("password/reset", PasswordReset.as_view(), name="resetPassword"),
    #path("password/reset/confirm", UserPasswordResetConfirmView.as_view(), name="resetPasswordConfirm"),
    path("password/reset", ResetPassword.as_view(), name="resetPassword"),
    path("password/reset/confirm", ResetPasswordConfirm.as_view(), name="resetPasswordConfirm"),
    path("email/change", changeEmail, name='changeEmail'),
    path("name/change", changeName, name='changeName'),
    path("password/change", changePassword, name='changePassword'),
    path("account", account, name='account')
]