Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(anonymisation): anonymiser les utiliseurs quand on le supprime en mettant leur initiales #1480

Merged
merged 6 commits into from
Sep 30, 2024

Conversation

carolineBda
Copy link
Contributor

No description provided.

})
.toPromise();

if (
deleteResult.data?.update_auth_users_by_pk.name !== userId ||
deleteResult.data?.update_auth_users_by_pk.id !== userId ||
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Du coup on avait un bug ici ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

non avant comme le nom était l'id on checkait le nom et ça marchait mais maintenant il faut bien checker sur l'id


UPDATE auth.users
SET name = 'CL'
WHERE id = 'aa6d1721-71e5-42a8-bf26-98f453d1fab5';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ca a du être sympa de retrouver les personnes 😄

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

j'ai regardé dans le fichier audit ^^

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pratique cette table audit :)

export const deleteUser = async (userId: string): Promise<boolean> => {
const anonymizeUser = (userName: string, userId: string): string => {
if (!userName?.length) return userId.slice(4);
return userName.toUpperCase().split(" ").map((word) => word[0]).join();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
return userName.toUpperCase().split(" ").map((word) => word[0]).join();
return userName.toUpperCase().split(" ").map((word) => word[0]).join("");

désolé 🙈

Copy link

sonarcloud bot commented Sep 26, 2024

Copy link

🎉 Deployment for commit 9145b27 :

Ingresses
Docker images
  • 📦 docker pull harbor.fabrique.social.gouv.fr/cdtn/cdtn-admin/export:sha-9145b27330d8cd3a291e7015460cc0880d37a4f6
  • 📦 docker pull harbor.fabrique.social.gouv.fr/cdtn/cdtn-admin/frontend:sha-9145b27330d8cd3a291e7015460cc0880d37a4f6
  • 📦 docker pull harbor.fabrique.social.gouv.fr/cdtn/cdtn-admin/hasura:sha-9145b27330d8cd3a291e7015460cc0880d37a4f6
Debug

@carolineBda carolineBda merged commit 831c37a into master Sep 30, 2024
25 checks passed
@carolineBda carolineBda deleted the carolineBda/anonymise-user branch September 30, 2024 14:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants