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:
2026-06-28 21:10:16 +03:00
co-authored by Cursor
parent 85b8b2e9b8
commit 4eb4c145b6
40 changed files with 2301 additions and 117 deletions
+16 -15
View File
@@ -1,6 +1,8 @@
from rest_framework.decorators import api_view
from rest_framework.permissions import AllowAny, IsAuthenticated
from rest_framework.response import Response
from rest_framework.views import APIView
from core.drf_mixins import JwtAuthMixin
from .choices import (
RELATION_TYPES,
LIFE_SPHERES,
@@ -10,21 +12,20 @@ from .choices import (
)
@api_view(['GET'])
def meta_choices(request):
"""Unified meta endpoint for all domain enums."""
return Response(choices_payload())
class MetaChoicesView(JwtAuthMixin, APIView):
def get(self, request):
return Response(choices_payload())
@api_view(['GET'])
def relation_types(request):
return Response([{'value': v, 'label': l} for v, l in RELATION_TYPES])
class RelationTypesView(JwtAuthMixin, APIView):
def get(self, request):
return Response([{'value': v, 'label': l} for v, l in RELATION_TYPES])
@api_view(['GET'])
def network_map_choices(request):
return Response({
'life_spheres': [{'value': v, 'label': l} for v, l in LIFE_SPHERES],
'network_circles': [{'value': v, 'label': l} for v, l in NETWORK_CIRCLES],
'interaction_intensities': [{'value': v, 'label': l} for v, l in INTERACTION_INTENSITY],
})
class NetworkMapChoicesView(JwtAuthMixin, APIView):
def get(self, request):
return Response({
'life_spheres': [{'value': v, 'label': l} for v, l in LIFE_SPHERES],
'network_circles': [{'value': v, 'label': l} for v, l in NETWORK_CIRCLES],
'interaction_intensities': [{'value': v, 'label': l} for v, l in INTERACTION_INTENSITY],
})