You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
"Invalid credentials. User is blocked" when trying to sign up an account that has been deleted before #744
Deleted my account but i had to reload the page after pressing the delete button to get logged out.
I tried to sign up a new user but now i get 401: Invalid credentials. User is blocked when trying to sign up and sign in.
To Reproduce
Setup clean instance op Appwrite
Sign up an account
Delete the account
Try to sign up a new account
Expected behavior
Should sign up the new account.
Actual Behavior
Displays the error message: "Registration Failed. Please try again later"
@saibotma I can confirm DELETE /account route does only account blocking and not actually deleting it. This was done to prevent abuse, the use case in mind was when a hacker take control over the account and maliciously deletes it. That way a developer can always recover the account.
In version 0.7 we have added real account deletion, but only limited to user DETELE /user/[user-id] route. @saibotma do you think we should change this behavior?
@TorstenDittmann as you were the one working on this area in 0.7, I would love to get your thoughts on this.
I think using the DELETE method is fine for the /account endpoint. Maybe adapt the sdk method name to block().
In terms of deleting the user, I would still recommend this to be Server SDK exclusive for security reasons.
I don't know what value a deleted state would give ,deleted means removed and not visible anymore IMO. Changing the method call to block might be sufficient enough to prevent confusion.
We started using the DELETE /account because that better reflects what the user want to achieve. That said, most use-cases I'm aware of, an as a best security practice this would be way to risky action to allow from the client.
I guess that if we'll change the method name to blockAccount, one of the most requested features here will be to add a delete method, which is not something we really want to support (mainly security wise). This might also make the REST compatibility a bit tricky and introduce some new naming conventions dilemmas.
The only implementation of giving users the ability to remove their accounts would be the following:
Request Account removal
Confirm by mail
Account deleted after x days if no session created past confirmation of the removal
This involves more work and is up to @eldadfux to adapt such pattern and how it's prioritized.
Edit: At this stage we could make delete() deleting the user and introduce block() for blocking. Even though that would be the most breaking change possible for SDK's 😄
@TorstenDittmann this sounds like a clean solution even though it is more complicated to implement.
What confused me was actually not the DELETE http method - I actually did not know about it - but the naming in the UI.
Renaming the UI from "delete" to "block" would probably help to avoid confusion.
However, I have to say that as an API user I would expect DELETE to really delete a resource and in order to block it I would use PATCH maybe.
The only implementation of giving users the ability to remove their accounts would be the following:
Request Account removal
Confirm by mail
Account deleted after x days if no session created past confirmation of the removal
This involves more work and is up to @eldadfux to adapt such pattern and how it's prioritized.
Edit: At this stage we are able to make delete() deleting the user and introduce block() for blocking.
I think this is a reasonable alternative, that will help reduce the security risk. One issue is that we can count on the user to have an email anymore as we plan to introduce new "email-less" login methods.
This would also require us to think of a way to provide a delete revert action (maybe in the dashboard?)
Sorry but i am a bit confused. Are we now talking about accounts or users, because according to the docs when deleting an account using DELETE it gets blocked.
This issue had no recent activity and looks more or less solved. I will close it and if further activity occurs can be re-opened again. Thank you for your contributions.
Activity
eldadfux commentedon Dec 1, 2020
@saibotma I can confirm DELETE /account route does only account blocking and not actually deleting it. This was done to prevent abuse, the use case in mind was when a hacker take control over the account and maliciously deletes it. That way a developer can always recover the account.
In version 0.7 we have added real account deletion, but only limited to user DETELE /user/[user-id] route. @saibotma do you think we should change this behavior?
@TorstenDittmann as you were the one working on this area in 0.7, I would love to get your thoughts on this.
saibotma commentedon Dec 1, 2020
Strangely enough the sign up did not work with an other new account not just the deleted one.
Maybe we should check this.
I think it's confusing than delete just blocks a user. It should then be named "block" instead of "delete".
eldadfux commentedon Dec 1, 2020
Would be great if you could confirm this is still happening and can be reproduced.
Edit: might be related to the old user session still trying to authenticate? still happens on a browser without cookies, or after cleaning them?
@saibotma or maybe have a new
deletedstatus? @TorstenDittmann what do you think?TorstenDittmann commentedon Dec 1, 2020
I think using the DELETE method is fine for the
/accountendpoint. Maybe adapt the sdk method name toblock().In terms of deleting the user, I would still recommend this to be Server SDK exclusive for security reasons.
I don't know what value a
deletedstate would give ,deleted means removed and not visible anymore IMO. Changing the method call toblockmight be sufficient enough to prevent confusion.eldadfux commentedon Dec 1, 2020
We started using the DELETE /account because that better reflects what the user want to achieve. That said, most use-cases I'm aware of, an as a best security practice this would be way to risky action to allow from the client.
I guess that if we'll change the method name to
blockAccount, one of the most requested features here will be to add a delete method, which is not something we really want to support (mainly security wise). This might also make the REST compatibility a bit tricky and introduce some new naming conventions dilemmas.TorstenDittmann commentedon Dec 1, 2020
The only implementation of giving users the ability to remove their accounts would be the following:
This involves more work and is up to @eldadfux to adapt such pattern and how it's prioritized.
Edit: At this stage we could make
delete()deleting the user and introduceblock()for blocking. Even though that would be the most breaking change possible for SDK's 😄saibotma commentedon Dec 1, 2020
@TorstenDittmann this sounds like a clean solution even though it is more complicated to implement.
What confused me was actually not the
DELETEhttp method - I actually did not know about it - but the naming in the UI.Renaming the UI from "delete" to "block" would probably help to avoid confusion.
However, I have to say that as an API user I would expect
DELETEto really delete a resource and in order to block it I would usePATCHmaybe.eldadfux commentedon Dec 1, 2020
I think this is a reasonable alternative, that will help reduce the security risk. One issue is that we can count on the user to have an email anymore as we plan to introduce new "email-less" login methods.
This would also require us to think of a way to provide a delete revert action (maybe in the dashboard?)
eldadfux commentedon Dec 1, 2020
Agree, and we actually do use PATCH to change the status from active to blocked in the Users API 🤨
saibotma commentedon Dec 1, 2020
Sorry but i am a bit confused. Are we now talking about accounts or users, because according to the docs when deleting an account using DELETE it gets blocked.
TorstenDittmann commentedon Dec 1, 2020
Account is the Client SDK endpoint for the currently logged in account. Users is the Server SDK Endpoint to manage all accounts 👍
saibotma commentedon Jan 19, 2021
Ah, now I get it. I was actually talking about Appwrite accounts, the accounts that have access to the dashboard.
eldadfux commentedon Jan 19, 2021
@saibotma the dashboard is using the exact same Appwrite APIs :) Account API for your dashboard user, Users API for managing your project users
TorstenDittmann commentedon Apr 6, 2021
This issue had no recent activity and looks more or less solved. I will close it and if further activity occurs can be re-opened again. Thank you for your contributions.