feat: Rollback signup on error, cleanup userDto and comment createdBy
This commit is contained in:
@@ -27,7 +27,7 @@ definePageMeta({ layout: 'auth' })
|
||||
useSeoMeta({ title: 'Sign up' })
|
||||
|
||||
const toast = useToast()
|
||||
const { signUp } = useAuth()
|
||||
const { signUp, deleteUser } = useAuth()
|
||||
const { createUser } = useUser()
|
||||
|
||||
const fields = [
|
||||
@@ -116,8 +116,9 @@ function onSubmit(payload: FormSubmitEvent<Schema>) {
|
||||
|
||||
await navigateTo('/')
|
||||
},
|
||||
onError: (ctx) => {
|
||||
onError: async (ctx) => {
|
||||
console.log(ctx.error.message)
|
||||
await deleteUser({ callbackURL: '/signup' })
|
||||
useToast().add({
|
||||
title: 'Fehler bei der Registrierung',
|
||||
description: ctx.error.message,
|
||||
|
||||
Reference in New Issue
Block a user