change user model to login routine

This commit is contained in:
Julian Krauser 2025-05-03 09:09:52 +02:00
parent c35b99e0c4
commit 03a5bb3592
5 changed files with 56 additions and 3 deletions

View file

@ -7,6 +7,7 @@ import UserService from "../service/management/userService";
import DatabaseActionException from "../exceptions/databaseActionException";
import { availableTemplates } from "../type/templateTypes";
import SettingHelper from "./settingsHelper";
import { LoginRoutineEnum } from "../enums/loginRoutineEnum";
export type BackupSection =
| "member"
@ -806,6 +807,7 @@ export default abstract class BackupHelper {
let roles = await this.transactionManager.getRepository("role").find();
let dataWithMappedIds = (data?.["user"] ?? []).map((u) => ({
...u,
routine: u.routine ?? LoginRoutineEnum.totp,
roles: u.roles.map((r: any) => ({
...r,
id: roles.find((role) => role.role == r.role)?.id ?? undefined,