please, how can I customise the get_payload function in django-graphql-jwt?
def get_payload(token, context=None):
try:
payload = jwt_settings.JWT_DECODE_HANDLER(token, context)
except jwt.ExpiredSignature:
raise exceptions.JSONWebTokenExpired()
except jwt.DecodeError:
raise exceptions.JSONWebTokenError(_('Error decoding signature'))
except jwt.InvalidTokenError:
raise exceptions.JSONWebTokenError(_('Invalid token'))
return payload
here is the solution that I did for the moment:
I added this
JWT_DECODE_HANDLER
setting toGRAPHQL_JWT
:than here is my
customized_jwt_decode
function: