# -*- coding: utf-8 -*-
"""
Adtlas Authentication URL Configuration

URL patterns for enhanced authentication functionality in the Adtlas DAI Management System.

Features:
    - Login/logout with remember me functionality
    - User registration with profile creation
    - Password reset with secure tokens
    
Author: Adtlas Development Team
Version: 2.0.0
Last Updated: 2025-07-09
"""

from django.urls import path 

from apps.authentication import views

app_name = "auth"
 
urlpatterns = [
    # Authentication URLs
    path("login", views.LoginView.as_view(), name="login"),
    path("logout", views.LogoutView.as_view(), name="logout"),
    path("register", views.RegisterView.as_view(), name="register"),
    
    # Password Reset URLs
    path("password-reset", views.PasswordResetRequestView.as_view(), name="password_reset_request"),
    path("password-reset/confirm/<uuid:token>", views.PasswordResetConfirmView.as_view(), name="password_reset_confirm"),
 
    # API Endpoints
    path("api/check-email", views.CheckEmailAvailabilityView.as_view(), name="check_email_availability"),
    
    #     # Password Reset
    # path('password-reset/', auth_views.PasswordResetView.as_view(
    #     template_name='accounts/password_reset.html',
    #     email_template_name='accounts/password_reset_email.html',
    #     subject_template_name='accounts/password_reset_subject.txt'
    # ), name='password_reset'),
    
    # path('password-reset/done/', auth_views.PasswordResetDoneView.as_view(
    #     template_name='accounts/password_reset_done.html'
    # ), name='password_reset_done'),
    
    # path('reset/<uidb64>/<token>/', auth_views.PasswordResetConfirmView.as_view(
    #     template_name='accounts/password_reset_confirm.html'
    # ), name='password_reset_confirm'),
    
    # path('reset/done/', auth_views.PasswordResetCompleteView.as_view(
    #     template_name='accounts/password_reset_complete.html'
    # ), name='password_reset_complete'),
    # ========================================================================
    # Authentication URLs
    # ========================================================================
    
    # Password change URLs (implemented)
    path(
        'password/change/',
        views.CustomPasswordChangeView.as_view(),
        name='password_change'
    ),
    path(
        'password/change/done/',
        views.CustomPasswordChangeDoneView.as_view(),
        name='password_change_done'
    ),
    # ========================================================================
    # Password Reset URLs
    # ========================================================================
    path(
        'password/reset/',
        views.CustomPasswordResetView.as_view(),
        name='password_reset'
    ),
    path(
        'password/reset/done/',
        views.CustomPasswordResetDoneView.as_view(),
        name='password_reset_done'
    ),
    path(
        'password/reset/confirm/<uidb64>/<token>/',
        views.CustomPasswordResetConfirmView.as_view(),
        name='password_reset_confirm'
    ),
    path(
        'password/reset/complete/',
        views.CustomPasswordResetCompleteView.as_view(),
        name='password_reset_complete'
    ),
    
    # Account activation URLs
    path(
        'activate/<uidb64>/<token>/',
        views.AccountActivationView.as_view(),
        name='account_activation'
    ),
    path(
        'activation/sent/',
        views.ActivationSentView.as_view(),
        name='activation_sent'
    ),
    path(
        'activation/complete/',
        views.ActivationCompleteView.as_view(),
        name='activation_complete'
    ),
]
