# urls.py
from django.urls import path
from django.contrib.auth.decorators import login_required
from django.contrib.auth import views as auth_views

from . import views
from at_django_boilerplate.accounts.api import v1 as api_v1

urlpatterns = [
    path('signup/', views.SignupView.as_view(), name='signup'),
    path('ajax/check_username/', views.CheckUsernameAvailability.as_view(), name='check_username'),

    path('login/', views.LoginPageView.as_view(), name='login'),
    path('login/', views.LoginPageView.as_view(), name='signin'),
    path('login', views.LoginPageView.as_view(), name='login'),
    path('login', views.LoginPageView.as_view(), name='signin'),

     path('profile/', login_required(views.ProfileView.as_view()), name='user_profile'),
     path('update_profile/<uuid:pk>', login_required(views.UpdateProfileView.as_view()), name='update_profile'),
     path('update_profile_picture/', login_required(views.update_profile_picture), name='update_profile_picture'),


    path('password-reset/', views.ResetPasswordView.as_view(), name='password_reset'),    
    path('password-reset/applied', views.ResetPasswordDoneView.as_view(), name='password_reset_done'),    

    path('password-reset-confirm/<uidb64>/<token>/',
         auth_views.PasswordResetConfirmView.as_view(template_name='reset/password_reset_confirm.html'),
         name='password_reset_confirm'),
    path('password-reset-complete/',
         auth_views.PasswordResetCompleteView.as_view(template_name='reset/password_reset_complete.html'),
         name='password_reset_complete'),
    path('password_change/',views.ChangePasswordView.as_view()),

     path('verify-email/', views.verify_email, name='verify-email'),
     path('verify-email/done/', views.verify_email_done, name='verify-email-done'),
     path('verify-email-confirm/<uidb64>/<token>/', views.verify_email_confirm, name='verify-email-confirm'),
     path('verify-email/complete/', views.verify_email_complete, name='verify-email-complete'),

    path('logout/', views.LogoutView.as_view(), name='logout'),

          # Otp via signin
     path('request-otp/', views.request_otp_view, name='request_otp'),
     path('verify-otp/', views.verify_otp_view, name='verify_otp'),

]


api_v1=[
     path('api/login/', api_v1.LoginApiView.as_view(), name='login-api'),
     path('validate-password/', api_v1.ValidatePasswordAPIView.as_view(), name='validate-password-api'),
     path('api/reset-password/', api_v1.ResetPasswordAPIView.as_view(), name='reset-password-api'),
     path('reset-password/<uidb64>/<token>/', api_v1.ResetPasswordConfirmAPIView.as_view(), name='reset-password-confirm'),
     path('api/profile/', api_v1.UserProfileView.as_view(), name='profile-api'),
]


urlpatterns +=api_v1