Conversation
…nto delete-route-for-account-deletion
|
What else is needed on this? I recall there was some issue with CORS or Cookies something? |
|
The main problem is that testing for this feature is a pain to do since it requires both naturalcrit and homebrewery to be running locally, and certain changes to be made (i don't recall specifics right now), it also cannot be tested in deployments for cookie domain reasons. These are also why i had many problems with the other functions, apart from my inexperience. I am going to come back to this shortly, lost my drive on this project, but i can do it nonetheless. |
…nto delete-route-for-account-deletion
|
@calculuschild this would be way easier if the account systems in local were connected like they are on live, otherwise its a mess, i can do it, but it is a mess. |
|
This should be done, but it cannot be tested thoroughly: to test in local you must make up a req.account object with at least a username |
|
this should be released before the actual deletion api is set in naturalcrit. |
They are connected in local in the same way. Or they should be; I used it extensively when I was implementing Google Drive integration. Log in via a naturalcrit server on localhost, and you will be logged in on the homebrewery at localhost. If you are not seeing that there is a bug somewhere, or I am misunderstanding what you mean. |
The logins are not connected for me at all, logins are kept or at least require hard reloads, and logging in homebrewery just requires you to type a username and it logs you in, while in naturalcrit you need to provide a valid username and password, how is that connected? |
We added the username-only login as a convenience for people using an offline deployment of Homebrewery. It creates a simplified cookie and does not go through the user authentication process at all. But if you have both servers running locally (probably naturalcrit on port :8010, and homebrewery on port :8000), including mongoDB databases for both, you should still be able to log in from the naturalcrit server. You will have to manually visit |
|
Huh, well, nevertheless, the PR works |
…m/naturalcrit/homebrewery into delete-route-for-account-deletion
…nto delete-route-for-account-deletion
Unfortunately, it still doesn't work. If there is more than one brew on an account, it only deletes the first one, and then crashes the Homebrewery side. The Naturalcrit side will continue to delete the account but the rest of the brews remain. Homebrewery provides this log: Looks like this line does not wan to be called more than once, i.e., can't reuse the same homebrewery/server/homebrew.api.js Line 529 in bfd1475 Before, you were directly deleting from homebrewModel, which would work, except that does not delete Google Drive documents, and also skips over some of the other possibilities (deleting yourself as author instead of the whole file if you are a co-author, etc.), and this is where I suggested we just reuse the api.deleteBrew(). However, I did not realize multiple responses would be an issue here. What we may need to do is pull out the core part of |
Description
Just one change, adds a deletion route in app.js, which makes a request to the delete method for all documents based on username.
The delete method should handle deletion or author removal automatically.
Related Issues or Discussion
I might transform this into a clone of the delete brew function but working in batches
After this PR is merged i plan on moving some of the routes in app.js into other files, as that one is starting to get gargantuan.