code: def authenticate(self, request):
          
          jwt_value = self.get_jwt_value(request)
          if jwt_value is None:
              return None
  
          try:
              payload = jwt_decode_handler(jwt_value)
          except jwt.ExpiredSignature:
              msg = _('Signature has expired.')
              raise exceptions.AuthenticationFailed(msg)
          except jwt.DecodeError:
              msg = _('Error decoding signature.')
              raise exceptions.AuthenticationFailed(msg)
          except jwt.InvalidTokenError:
              raise exceptions.AuthenticationFailed()
  
          user = self.authenticate_credentials(payload)
  
          return (user, jwt_value)
docs: Returns a two-tuple of `User` and token if a valid signature has been
          supplied using JWT-based authentication.  Otherwise returns `None`.