Skip to content

Instantly share code, notes, and snippets.

View nawarazpokhrel's full-sized avatar
💭
I may be slow to respond.

Navaraj nawarazpokhrel

💭
I may be slow to respond.
  • Olive Group
  • Kathmandu
  • 08:14 (UTC -12:00)
View GitHub Profile
@orehush
orehush / serializers.py
Last active December 18, 2023 14:23
DRF simple JWT logout flow
from django.utils.text import gettext_lazy as _
from rest_framework import serializers
from rest_framework_simplejwt.tokens import RefreshToken, TokenError
class RefreshTokenSerializer(serializers.Serializer):
refresh = serializers.CharField()
default_error_messages = {
'bad_token': _('Token is invalid or expired')
}