Last active
December 27, 2017 11:11
-
-
Save smmoosavi/7bb5e3ce7adc9b76f6c6da45f63b40e5 to your computer and use it in GitHub Desktop.
Revisions
-
smmoosavi revised this gist
May 26, 2017 . 2 changed files with 3 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -8,4 +8,5 @@ def mutate_and_get_payload(cls, input, context, info): if not user.check_password(old_password): raise ResponseError( "Invalid Password", code='invalid_old_password') # ... This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,7 +2,7 @@ mutation { changePassword(input: { oldPassword: "wrongPassword" newPassword: "some-password" }) { success } } -
smmoosavi created this gist
May 26, 2017 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,11 @@ @classmethod def mutate_and_get_payload(cls, input, context, info): user = context.user old_password = input.get('old_password') new_password = input.get('new_password') if user.has_usable_password(): if not user.check_password(old_password): raise ResponseError( "Invalid Password", code='invalid_old_password') This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,8 @@ mutation { changePassword(input: { oldPassword: "wrongPassword" newPassword: "some-password" }){ success } } This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,12 @@ { "errors": [ { "message": "Invalid Password", "code": "invalid-old-password", "params": null } ], "data": { "changePassword": null } }