Add account deletion process and improve tests
The commit introduces a message to indicate the account deletion process. It also enhances the tests by reducing code redundancy in the e2e tests, creating a more random name for team accounts, and improving the navigation process after account deletions. The commit also includes code cleanup tasks, such as the removal of unused imports.
This commit is contained in:
@@ -142,7 +142,11 @@ function DeleteAccountSubmitButton() {
|
||||
name={'action'}
|
||||
variant={'destructive'}
|
||||
>
|
||||
<Trans i18nKey={'account:deleteAccount'} />
|
||||
{pending ? (
|
||||
<Trans i18nKey={'account:deletingAccount'} />
|
||||
) : (
|
||||
<Trans i18nKey={'account:deleteAccount'} />
|
||||
)}
|
||||
</Button>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
'use server';
|
||||
|
||||
import { revalidatePath } from 'next/cache';
|
||||
import { RedirectType, redirect } from 'next/navigation';
|
||||
import { redirect } from 'next/navigation';
|
||||
|
||||
import { z } from 'zod';
|
||||
|
||||
@@ -66,10 +66,11 @@ export async function deletePersonalAccountAction(formData: FormData) {
|
||||
// sign out the user after deleting their account
|
||||
await client.auth.signOut();
|
||||
|
||||
// clear the cache for all pages
|
||||
revalidatePath('/', 'layout');
|
||||
|
||||
// redirect to the home page
|
||||
redirect('/', RedirectType.replace);
|
||||
redirect('/');
|
||||
}
|
||||
|
||||
function getEmailSettingsFromEnvironment() {
|
||||
|
||||
Reference in New Issue
Block a user