Added auth, environment brief, docker for db_migrations,frontend,backend.

This commit is contained in:
2025-12-15 23:40:34 +01:00
parent 3ab81fad8c
commit 1a5bef277d
36 changed files with 1059 additions and 132 deletions

View File

@@ -0,0 +1,23 @@
"""
Custom JWT serializers for IoT Dashboard.
Handles string-based user IDs instead of integer IDs.
"""
from rest_framework_simplejwt.serializers import TokenObtainPairSerializer
from rest_framework_simplejwt.tokens import RefreshToken
class CustomTokenObtainPairSerializer(TokenObtainPairSerializer):
"""
Custom token serializer that handles string user IDs.
"""
@classmethod
def get_token(cls, user):
token = RefreshToken.for_user(user)
# Add custom claims
token['username'] = user.username
token['email'] = user.email
return token