Skip to content

Commit

Permalink
Clarify the text around deleting console account
Browse files Browse the repository at this point in the history
Console accounts are not actually deleted so a user won't be able to
re-create their account after "deleting" it.
  • Loading branch information
stnguyen90 committed May 24, 2023
1 parent 3a0c8f0 commit 11d61d1
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/routes/console/account/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -154,10 +154,10 @@
</Form>
<CardGrid danger>
<div>
<Heading tag="h6" size="7">Delete Account</Heading>
<Heading tag="h6" size="7">Deactivate Account</Heading>
</div>
<p>
Your account will be permanently deleted and access will be lost to any of your teams
Your account will be permanently deactivated and access will be lost to any of your teams
and data. This action is irreversible.
</p>
<svelte:fragment slot="aside">
Expand Down
24 changes: 19 additions & 5 deletions src/routes/console/account/delete.svelte
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
<script lang="ts">
import { invalidate } from '$app/navigation';
import { Submit, trackEvent, trackError } from '$lib/actions/analytics';
import { Submit, trackError, trackEvent } from '$lib/actions/analytics';
import { Modal } from '$lib/components';
import { Dependencies } from '$lib/constants';
import { Button } from '$lib/elements/forms';
import { Button, FormList, InputText } from '$lib/elements/forms';
import { addNotification } from '$lib/stores/notifications';
import { sdkForConsole } from '$lib/stores/sdk';
import { user } from '$lib/stores/user';
export let showDelete = false;
let email: string = null;
const deleteAccount = async () => {
try {
Expand All @@ -30,10 +32,22 @@
</script>

<Modal bind:show={showDelete} on:submit={deleteAccount} warning>
<svelte:fragment slot="header">Delete Account</svelte:fragment>
<p>Are you sure you want to delete your account?</p>
<svelte:fragment slot="header">Deactivate Account</svelte:fragment>
<p>
Are you sure you want to deactivate your account? <b
>This action is irreversible, and you cannot create a new account again with this email.</b>
</p>
<FormList>
<InputText
label={`Enter "${$user.email}" to continue`}
placeholder="Enter email"
id="user-email"
autofocus
required
bind:value={email} />
</FormList>
<svelte:fragment slot="footer">
<Button text on:click={() => (showDelete = false)}>Cancel</Button>
<Button secondary submit>Delete</Button>
<Button disabled={!email || email !== $user.email} secondary submit>Delete</Button>
</svelte:fragment>
</Modal>

0 comments on commit 11d61d1

Please sign in to comment.