mirror of
https://github.com/pacnpal/thrillwiki_django_no_react.git
synced 2025-12-20 12:51:09 -05:00
- Added migration to transition avatar data from CloudflareImageField to ForeignKey structure in UserProfile. - Fixed UserProfileEvent avatar field to align with new avatar structure. - Created serializers for social authentication, including connected and available providers. - Developed request logging middleware for comprehensive request/response logging. - Updated moderation and parks migrations to remove outdated triggers and adjust foreign key relationships. - Enhanced rides migrations to ensure proper handling of image uploads and triggers. - Introduced a test script for the 3-step avatar upload process, ensuring functionality with Cloudflare. - Documented the fix for avatar upload issues, detailing root cause, implementation, and verification steps. - Implemented automatic deletion of Cloudflare images upon avatar, park, and ride photo changes or removals.
105 lines
2.9 KiB
Python
105 lines
2.9 KiB
Python
"""
|
|
Auth domain URL Configuration for ThrillWiki API v1.
|
|
|
|
This module contains URL patterns for core authentication functionality only.
|
|
User profiles and top lists are handled by the dedicated accounts app.
|
|
"""
|
|
|
|
from django.urls import path, include
|
|
from .views import (
|
|
# Main auth views
|
|
LoginAPIView,
|
|
SignupAPIView,
|
|
LogoutAPIView,
|
|
CurrentUserAPIView,
|
|
PasswordResetAPIView,
|
|
PasswordChangeAPIView,
|
|
SocialProvidersAPIView,
|
|
AuthStatusAPIView,
|
|
# Email verification views
|
|
EmailVerificationAPIView,
|
|
ResendVerificationAPIView,
|
|
# Social provider management views
|
|
AvailableProvidersAPIView,
|
|
ConnectedProvidersAPIView,
|
|
ConnectProviderAPIView,
|
|
DisconnectProviderAPIView,
|
|
SocialAuthStatusAPIView,
|
|
)
|
|
from rest_framework_simplejwt.views import TokenRefreshView
|
|
|
|
|
|
urlpatterns = [
|
|
# Core authentication endpoints
|
|
path("login/", LoginAPIView.as_view(), name="auth-login"),
|
|
path("signup/", SignupAPIView.as_view(), name="auth-signup"),
|
|
path("logout/", LogoutAPIView.as_view(), name="auth-logout"),
|
|
path("user/", CurrentUserAPIView.as_view(), name="auth-current-user"),
|
|
|
|
# JWT token management
|
|
path("token/refresh/", TokenRefreshView.as_view(), name="auth-token-refresh"),
|
|
|
|
# Social authentication endpoints (dj-rest-auth)
|
|
path("social/", include("dj_rest_auth.registration.urls")),
|
|
|
|
path(
|
|
"password/reset/",
|
|
PasswordResetAPIView.as_view(),
|
|
name="auth-password-reset",
|
|
),
|
|
path(
|
|
"password/change/",
|
|
PasswordChangeAPIView.as_view(),
|
|
name="auth-password-change",
|
|
),
|
|
path(
|
|
"social/providers/",
|
|
SocialProvidersAPIView.as_view(),
|
|
name="auth-social-providers",
|
|
),
|
|
|
|
# Social provider management endpoints
|
|
path(
|
|
"social/providers/available/",
|
|
AvailableProvidersAPIView.as_view(),
|
|
name="auth-social-providers-available",
|
|
),
|
|
path(
|
|
"social/connected/",
|
|
ConnectedProvidersAPIView.as_view(),
|
|
name="auth-social-connected",
|
|
),
|
|
path(
|
|
"social/connect/<str:provider>/",
|
|
ConnectProviderAPIView.as_view(),
|
|
name="auth-social-connect",
|
|
),
|
|
path(
|
|
"social/disconnect/<str:provider>/",
|
|
DisconnectProviderAPIView.as_view(),
|
|
name="auth-social-disconnect",
|
|
),
|
|
path(
|
|
"social/status/",
|
|
SocialAuthStatusAPIView.as_view(),
|
|
name="auth-social-status",
|
|
),
|
|
|
|
path("status/", AuthStatusAPIView.as_view(), name="auth-status"),
|
|
|
|
# Email verification endpoints
|
|
path(
|
|
"verify-email/<str:token>/",
|
|
EmailVerificationAPIView.as_view(),
|
|
name="auth-verify-email",
|
|
),
|
|
path(
|
|
"resend-verification/",
|
|
ResendVerificationAPIView.as_view(),
|
|
name="auth-resend-verification",
|
|
),
|
|
]
|
|
|
|
# Note: User profiles and top lists functionality is now handled by the accounts app
|
|
# to maintain clean separation of concerns and avoid duplicate API endpoints.
|