feat: Add team deletion flow for cloud-hosted (#5717)

This commit is contained in:
Tom Moor
2023-08-21 20:24:46 -04:00
committed by GitHub
parent 5c07694f6b
commit 418d3305b2
26 changed files with 461 additions and 71 deletions

View File

@@ -30,7 +30,7 @@ function UserDelete() {
ev.preventDefault();
try {
await auth.requestDelete();
await auth.requestDeleteUser();
setWaitingCode(true);
} catch (error) {
showToast(error.message, {
@@ -71,16 +71,8 @@ function UserDelete() {
enter the code below to permanantly destroy your account.
</Trans>
</Text>
<Text type="secondary">
<Trans
defaults="<em>Note:</em> Signing back in will cause a new account to be automatically reprovisioned."
components={{
em: <strong />,
}}
/>
</Text>
<Input
placeholder="CODE"
placeholder={t("Confirmation code")}
autoComplete="off"
autoFocus
maxLength={8}
@@ -105,10 +97,14 @@ function UserDelete() {
{t("Continue")}
</Button>
) : (
<Button type="submit" disabled={formState.isSubmitting} danger>
<Button
type="submit"
disabled={formState.isSubmitting || !formState.isValid}
danger
>
{formState.isSubmitting
? `${t("Deleting")}`
: t("Delete My Account")}
: t("Delete my account")}
</Button>
)}
</form>