ilya_shyian il y a 2 ans
Parent
commit
a9fcd006a1
1 fichiers modifiés avec 1 ajouts et 11 suppressions
  1. 1 11
      store_back/apps/authAPI/schema.py

+ 1 - 11
store_back/apps/authAPI/schema.py

@@ -17,16 +17,6 @@ import graphql_jwt
 User = get_user_model()
 
 
-class ObtainJSONWebToken(graphql_jwt.ObtainJSONWebToken):
-
-    @classmethod
-    def mutate(cls, *args, **kwargs):
-        try:
-            return super().mutate()
-        except JSONWebTokenError:
-            raise Exception('Invalid credentials ')
-
-
 class UserType(graphene.ObjectType):
     _id = graphene.String(name='_id')
     avatar = graphene.Field(ImageType)
@@ -244,7 +234,7 @@ class UserUpsert(graphene.Mutation):
 
 
 class Mutations(graphene.ObjectType):
-    token_auth = ObtainJSONWebToken.Field()
+    token_auth = graphql_jwt.ObtainJSONWebToken.Field()
     verify_token = graphql_jwt.Verify.Field()
     refresh_token = graphql_jwt.Refresh.Field()