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:
+16
-15
@@ -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],
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user