Integrate Deutsche Post shipping API and models
Added Deutsche Post as a shipping carrier, including new models, admin, serializers, and API client integration. Updated Carrier and SiteConfiguration models to support Deutsche Post, including shipping price and API credentials. Added requirements for the Deutsche Post API client and dependencies.
This commit is contained in:
@@ -20,12 +20,18 @@ password_reset_token = PasswordResetTokenGenerator()
|
||||
from rest_framework_simplejwt.authentication import JWTAuthentication
|
||||
from rest_framework_simplejwt.exceptions import InvalidToken, TokenError
|
||||
|
||||
#NEMĚNIT CUSTOM SBÍRANÍ COOKIE TOKENU
|
||||
#COOKIE + AUTHORIZATION HEADER JWT AUTHENTICATION FOR AXIOS COMPATIBILITY
|
||||
class CookieJWTAuthentication(JWTAuthentication):
|
||||
def authenticate(self, request):
|
||||
|
||||
# First try Authorization header (standard axios pattern)
|
||||
header_token = self.get_header(request)
|
||||
if header_token is not None:
|
||||
validated_token = self.get_validated_token(header_token)
|
||||
return self.get_user(validated_token), validated_token
|
||||
|
||||
# Fallback to cookie-based authentication
|
||||
raw_token = request.COOKIES.get('access_token')
|
||||
|
||||
|
||||
if not raw_token:
|
||||
return None
|
||||
|
||||
|
||||
Reference in New Issue
Block a user