mirror of
https://github.com/jcreek/SvelteKitSaasBoilerplate.git
synced 2026-07-15 20:13:50 +00:00
feat(#55): Enable deleting account and anonymising purchases and subscriptions (no email sending)
This commit is contained in:
@@ -26,6 +26,16 @@
|
||||
update();
|
||||
};
|
||||
};
|
||||
|
||||
const handleAccountDeletion: SubmitFunction = () => {
|
||||
loading = true;
|
||||
if (session.user && session.user.email) {
|
||||
alert('Check your email to confirm account deletion.');
|
||||
}
|
||||
return async () => {
|
||||
loading = false;
|
||||
};
|
||||
};
|
||||
</script>
|
||||
|
||||
<div class="form-widget">
|
||||
@@ -56,4 +66,10 @@
|
||||
<button class="button block" disabled={loading}>Sign Out</button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<form method="post" action="?/delete" use:enhance={handleAccountDeletion}>
|
||||
<div>
|
||||
<button class="button block" disabled={loading}>Delete My Account</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user