Skip to content

Sync-in · Sovereign platform for file storage, sharing, synchronization, and collaboration.

fix(backend:users): handle guest login rename without space location rename

johaven2627d2d715cc
diff --git a/backend/src/applications/users/services/admin-users-manager.service.ts b/backend/src/applications/users/services/admin-users-manager.service.ts
index 92fb6779..872e5b86 100644
--- a/backend/src/applications/users/services/admin-users-manager.service.ts
+++ b/backend/src/applications/users/services/admin-users-manager.service.ts
@@ -95,8 +95,10 @@ export class AdminUsersManager {
if (await this.adminQueries.usersQueries.checkUserExists(v)) {
throw new HttpException('Login already used', HttpStatus.FORBIDDEN)
}
- if (!(await this.renameUserSpace(user.login, v))) {
- throw new HttpException('Unable to rename user space', HttpStatus.INTERNAL_SERVER_ERROR)
+ if (userRole === USER_ROLE.USER) {
+ if (!(await this.renameUserSpace(user.login, v))) {
+ throw new HttpException('Unable to rename user space', HttpStatus.INTERNAL_SERVER_ERROR)
+ }
}
updateUser.login = v
break