Add JWT auth with per-user data isolation and account settings.
Users can register, log in, and manage profile/password in a personal account page; server data is scoped by owner across contacts, maps, tags, and import. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -1,15 +1,12 @@
|
||||
from django.urls import path
|
||||
from rest_framework_simplejwt.views import TokenObtainPairView, TokenRefreshView
|
||||
|
||||
urlpatterns = []
|
||||
from .auth_views import ChangePasswordView, MeView, RegisterView
|
||||
|
||||
try:
|
||||
from django.conf import settings
|
||||
if getattr(settings, 'USE_JWT_AUTH', False):
|
||||
from rest_framework_simplejwt.views import TokenObtainPairView, TokenRefreshView
|
||||
|
||||
urlpatterns = [
|
||||
path('auth/token/', TokenObtainPairView.as_view(), name='token_obtain_pair'),
|
||||
path('auth/token/refresh/', TokenRefreshView.as_view(), name='token_refresh'),
|
||||
]
|
||||
except ImportError:
|
||||
pass
|
||||
urlpatterns = [
|
||||
path('auth/register/', RegisterView.as_view(), name='auth_register'),
|
||||
path('auth/me/', MeView.as_view(), name='auth_me'),
|
||||
path('auth/me/password/', ChangePasswordView.as_view(), name='auth_change_password'),
|
||||
path('auth/token/', TokenObtainPairView.as_view(), name='token_obtain_pair'),
|
||||
path('auth/token/refresh/', TokenRefreshView.as_view(), name='token_refresh'),
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user