diff --git a/packages/backend/src/auth/guards/structure-information-access.guard.ts b/packages/backend/src/auth/guards/structure-information-access.guard.ts
index b7f5f11855..f6212ec3e3 100644
--- a/packages/backend/src/auth/guards/structure-information-access.guard.ts
+++ b/packages/backend/src/auth/guards/structure-information-access.guard.ts
@@ -19,7 +19,7 @@ export class StructureInformationAccessGuard implements CanActivate {
typeof r.user.structureId === "undefined"
) {
appLogger.error(
- `[StructureInformationAccessGuard] invalid uuid or structureId`,
+ "[StructureInformationAccessGuard] invalid uuid or structureId",
{
sentry: true,
context: {
@@ -49,7 +49,7 @@ export class StructureInformationAccessGuard implements CanActivate {
r.structureInformation = structureInformation;
return r;
} catch (e) {
- appLogger.error(`[UsagerAccessGuard] structureInformation not found`, {
+ appLogger.error("[UsagerAccessGuard] structureInformation not found", {
sentry: true,
context: {
uuid,
diff --git a/packages/backend/src/auth/services/auth-checker.service.ts b/packages/backend/src/auth/services/auth-checker.service.ts
index 8dce75268e..c698cdf1fa 100644
--- a/packages/backend/src/auth/services/auth-checker.service.ts
+++ b/packages/backend/src/auth/services/auth-checker.service.ts
@@ -20,7 +20,7 @@ function checkRole(
const isValidRole = user && expectedRoles.includes(user.role);
if (user && !isValidRole) {
- appLogger.error(`[authChecker] invalid role`, {
+ appLogger.error("[authChecker] invalid role", {
sentry: true,
context: { role: user.role, user: user.id, expectedRoles },
});
@@ -37,7 +37,7 @@ function checkProfile(
const isValidRole = user && expectedProfiles.includes(userProfile);
if (user && !isValidRole) {
- appLogger.error(`[authChecker] invalid profile`, {
+ appLogger.error("[authChecker] invalid profile", {
context: { userProfile, user: user._userId, expectedProfiles },
});
}
diff --git a/packages/backend/src/modules/mails/services/templates-renderers/user-reset-password/userResetPasswordEmailSender.service.ts b/packages/backend/src/modules/mails/services/templates-renderers/user-reset-password/userResetPasswordEmailSender.service.ts
index fd7dfa5d26..168521f0f3 100644
--- a/packages/backend/src/modules/mails/services/templates-renderers/user-reset-password/userResetPasswordEmailSender.service.ts
+++ b/packages/backend/src/modules/mails/services/templates-renderers/user-reset-password/userResetPasswordEmailSender.service.ts
@@ -54,7 +54,7 @@ async function sendMail({
meta: { "lien de ré-initialisation": lien },
};
- messageEmailSender.sendMessageLater(messageContent, {
+ await messageEmailSender.sendMessageLater(messageContent, {
messageEmailId,
});
}
diff --git a/packages/backend/src/modules/portail-admin/controllers/admin-structures/admin-structures.controller.ts b/packages/backend/src/modules/portail-admin/controllers/admin-structures/admin-structures.controller.ts
index f6cbd9b255..c5f234e1b9 100644
--- a/packages/backend/src/modules/portail-admin/controllers/admin-structures/admin-structures.controller.ts
+++ b/packages/backend/src/modules/portail-admin/controllers/admin-structures/admin-structures.controller.ts
@@ -6,6 +6,7 @@ import {
HttpStatus,
Res,
UseGuards,
+ Param,
} from "@nestjs/common";
import { AuthGuard } from "@nestjs/passport";
import { ApiBearerAuth, ApiTags } from "@nestjs/swagger";
@@ -23,6 +24,8 @@ import { ExpressResponse } from "../../../../util/express";
import {
UserAdminAuthenticated,
UserStructureAuthenticated,
+ UserStructureSecurityEvent,
+ UserStructureTokens,
} from "../../../../_common/model";
import { AdminStructuresService } from "../../services";
import { CurrentUser } from "../../../../auth/decorators/current-user.decorator";
@@ -30,7 +33,12 @@ import { UsersController } from "../../../../users/controllers/users.controller"
import { RegisterUserAdminDto } from "../../../../users/dto";
import { format } from "date-fns";
import { structureCreatorService } from "../../../../structures/services";
-import { DEPARTEMENTS_MAP, REGIONS_LISTE, Structure } from "@domifa/common";
+import {
+ DEPARTEMENTS_MAP,
+ REGIONS_LISTE,
+ Structure,
+ UserStructure,
+} from "@domifa/common";
import { MetabaseStatsDto } from "../../_dto/MetabaseStats.dto";
import { domifaConfig } from "../../../../config";
import { sign } from "jsonwebtoken";
@@ -40,6 +48,10 @@ import { StructureConfirmationDto } from "../../_dto";
import { StructureAdminForList } from "../../types";
import { userAccountActivatedEmailSender } from "../../../mails/services/templates-renderers";
+export type UserStructureWithSecurity = UserStructure & {
+ temporaryTokens: UserStructureTokens;
+ events: UserStructureSecurityEvent;
+};
@UseGuards(AuthGuard("jwt"), AppUserGuard)
@Controller("admin/structures")
@ApiTags("dashboard")
@@ -98,6 +110,42 @@ export class AdminStructuresController {
return await this.adminStructuresService.getAdminStructuresListData();
}
+ @Get("structure/:structureId")
+ @AllowUserProfiles("super-admin-domifa")
+ public async getStructure(
+ @CurrentUser() _user: UserAdminAuthenticated,
+ @Param("structureId") structureId: number
+ ): PromiseVotre fichier est prêt à être importé !