feat: Rollback signup on error, cleanup userDto and comment createdBy

This commit is contained in:
2025-08-11 06:55:55 +02:00
parent 851d0fef46
commit b7b6d02cf2
6 changed files with 14 additions and 20 deletions

View File

@@ -50,6 +50,11 @@ export function useAuth() {
fetchOptions: {
headers
},
user: {
deleteUser: {
enabled: true
}
},
plugins: [
organizationClient({
// Pass the same access control instance and roles to client
@@ -158,25 +163,19 @@ export function useAuth() {
return res
}
const userDto = computed<UserDto>(() => ({
id: user.value?.id ?? '',
name: user.value?.name ?? 'Unknown'
}))
return {
session,
user,
userDto,
loggedIn: computed(() => !!session.value),
signIn: client.signIn,
signUp: client.signUp,
deleteUser: client.deleteUser,
signOut,
organization: client.organization,
organizations,
selectedOrganization,
options,
fetchSession,
fetchJwtAndOrganizations,
client,
jwt,
isPublicRoute,