Closed FreekVR closed 4 years ago
This is a good one, I think it can be something we can do. if you can make a PR that would be awesome if not i'll find some time to see this as soon as I can.
I'm implementing this by extending the class in our app, so as soon as that's working I'll see about sending the PR 👍
Added this here https://github.com/joselfonseca/lighthouse-graphql-passport-auth/pull/107, will go out in the 5.0 release.
https://github.com/joselfonseca/lighthouse-graphql-passport-auth/blob/master/src/GraphQL/Mutations/ResetPassword.php
Currently, when using an incorrect token or for any other type of error, a custom response with a "message" and "status" is used. Our frontend app however relies on normal exceptions which are returned following the graphQL spec.
The UpdatePassword simply throws a validation error when the "old password" is incorrect (https://github.com/joselfonseca/lighthouse-graphql-passport-auth/blob/master/src/GraphQL/Mutations/UpdatePassword.php) so I'd suggest a validation error for an invalid (reset) token would be consistent.