Menu

Deleting an account in our app is one line of SQL, and the audit row has to be written before it runs
📰

Deleting an account in our app is one line of SQL, and the audit row has to be written before it runs

DEV Community: postgres·Daniel Pertu·9 days ago
#k9g4PTLe
#devtopostgresql#devto#dev#account#delete
Reading 0:00
15s threshold

Nakodo is an outreach app for brands. The deal it makes about data is written out on the privacy page : you can export what is yours, and you can delete the account, and deleting means deleting.

You can watch the last step of it happen without having an account. This URL is the page a deleted account is sent to:

nakodo.app/?deleted=1

$ curl -s "https://nakodo.app/?deleted=1" | grep -o "Your account and its data have been deleted" Your account and its data have been deleted $ curl -s "https://nakodo.app/" | grep -c "have been deleted" 0

Enter fullscreen mode

Exit fullscreen mode

This post is everything that happens before that redirect.

The whole routine

export async function deleteAccountAction ( _ : unknown , form : FormData ): Promise < ActionResult > { const user = await requireUser (); const { email } = formText ( form , " email " ); if ( ! email || email . toLowerCase () !== user . email . toLowerCase ()) return fail ( " Type your account email exactly to confirm.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.