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>
17 lines
467 B
Python
17 lines
467 B
Python
from rest_framework.permissions import AllowAny, IsAuthenticated
|
|
from rest_framework_simplejwt.authentication import JWTAuthentication
|
|
|
|
from core.access import use_jwt_auth
|
|
|
|
|
|
class JwtAuthMixin:
|
|
def get_permissions(self):
|
|
if use_jwt_auth():
|
|
return [IsAuthenticated()]
|
|
return [AllowAny()]
|
|
|
|
def get_authenticators(self):
|
|
if use_jwt_auth():
|
|
return [JWTAuthentication()]
|
|
return super().get_authenticators()
|