jpadilla / django-rest-framework-jwt

JSON Web Token Authentication support for Django REST Framework
http://jpadilla.github.io/django-rest-framework-jwt/
MIT License
3.19k stars 650 forks source link

ObtainJSONWebToken endpoint not working for user.is_active = False #428

Closed sbishnu019 closed 6 years ago

sbishnu019 commented 6 years ago

when user is not active..endpoint does not shows "User account is disabled"

??????? if all(credentials.values()): user = authenticate(**credentials)

        if user:
            if not user.is_active:
                msg = _('User account is disabled.')
                raise serializers.ValidationError(msg)

            payload = jwt_payload_handler(user)

            return {
                'token': jwt_encode_handler(payload),
                'user': user
            }
        else:
            msg = _('Unable to log in with provided credentials.')
            raise serializers.ValidationError(msg)
oliviarves commented 6 years ago

@xzibiit What does it show? Could you give more info?

sbishnu019 commented 6 years ago

i figured out the problem tx...