graphql-authentication icon indicating copy to clipboard operation
graphql-authentication copied to clipboard

Deleting users isn't working

Open brimby opened this issue 3 years ago • 7 comments

When trying to delete a user I was getting the error Cannot query field \"deleteAccount\" on type \"Mutation\".

Since I was using your mutation code directly from the docs I figured there was perhaps a typo in the docs, so I searched "deleteAccount" in the codebase to see if I could find the syntax you used, but it turns out that "deleteAccount" is never mentioned in the codebase anywhere. So I tried searching just simply "delete" and I only found things related to deleting tokens.

Did the code for deleting users get lost somewhere or am I losing my head?

brimby avatar Nov 12 '22 03:11 brimby

I was using the following mutation: (yes, even the hardcoded password part because I was going to work it out in steps): mutation DeleteAccount { deleteAccount( password: "testing1234" confirmPassword: "testing1234" ) }

brimby avatar Nov 12 '22 03:11 brimby

Oh I see now, you have it on Craft 4 but not 3. Any chance you're going to add it to 3 or is it just time I upgraded?

brimby avatar Nov 12 '22 04:11 brimby

I brought the deleteAccount code over into my Craft 3 project locally and it works. I'd send a pull request except I'm not sure if/how I can send a pull request for a v1 change rather than a v2 change. Sorry I'm not super good with github. If there is a way to submit a pull request for the Craft3 compatible branch/fork, let me know and I'll send it along.

If it's not possible, then I'm fine just running my custom code locally.

brimby avatar Nov 14 '22 16:11 brimby

@brimby I'm backporting some Craft 4 changes that we need internally for work on a Craft 3 site, so I can bring across this mutation. I'll try and get that done over the next week or so.

Thanks!

jamesedmonston avatar Nov 18 '22 10:11 jamesedmonston

Are you still planning on backporting this? If you're wanting to bail on Craft 3, I understand. I'm just trying to make a plan. If you'd like me to send you my repo zip where I implemented this locally, I can. I just don't know how to make a pull request for the 1.0 version of the project (is that possible?)

brimby avatar Apr 20 '23 18:04 brimby

@brimby Sorry for the delay (I noticed you forked the plugin and added your local changes – sorry you had to faff around with that).

I've backported all the Craft 4 changes to https://github.com/jamesedmonston/graphql-authentication/tree/craft3 (https://github.com/jamesedmonston/graphql-authentication/commit/503d6497a39261b7c713c645947302241dfbfb84 & https://github.com/jamesedmonston/graphql-authentication/commit/9c4e17e81c7c172102f4d5447144b14398ab4ab8).

I've not yet fully tested everything, so please let me know if anything breaks for you.

I hope to have it fully tested and released soon.

Note: there's some incomplete 2FA work in there, which'll get added to the Craft 3 version, too.

jamesedmonston avatar May 12 '23 13:05 jamesedmonston

No problem, mate. I can't imagine how time intensive it is to maintain a public product, even if it's just a plugin. I'm the dummy still back on craft 3 for some reason. Thanks for getting that done though!

brimby avatar May 14 '23 19:05 brimby