You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .claude/commands/create-migration-guide.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -74,6 +74,8 @@ Always analyze:
74
74
75
75
Use the template at `migration-guides/TEMPLATE.md` and follow the process in `.claude/rules/migration-guides.md`.
76
76
77
+
**IMPORTANT: All migration guides MUST be written in English.** This includes all section titles, descriptions, code comments, and explanations. Technical terms and code identifiers remain unchanged.
Copy file name to clipboardExpand all lines: .claude/rules/migration-guides.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -78,6 +78,7 @@ Use `migration-guides/TEMPLATE.md` as starting point.
78
78
7.**Module Documentation** - Links to affected module docs (README.md, INTEGRATION-CHECKLIST.md)
79
79
80
80
**Rules:**
81
+
-**Write ALL content in English** - This includes section titles, descriptions, explanations, and code comments. Technical terms and code identifiers remain unchanged.
81
82
- Do NOT name specific customer projects (except nest-server-starter as reference)
82
83
- Keep information general and pattern-based
83
84
- Include code examples for all changes
@@ -107,6 +108,7 @@ ls src/core/modules/**/INTEGRATION-CHECKLIST.md
107
108
108
109
## Guide Quality Checklist
109
110
111
+
-[ ]**Written entirely in English**
110
112
-[ ] Overview table is complete
111
113
-[ ] Quick migration path provided
112
114
-[ ] All breaking changes documented with before/after
const user =awaitthis.tokenService.verifyAndLoadUser(token);
182
+
if (user) {
183
+
request.user=user;
184
+
}
185
+
}
186
+
```
187
+
188
+
### 7. IAM-only Mode Support (registerRolesGuardGlobally)
189
+
190
+
New option `registerRolesGuardGlobally` in `CoreBetterAuthModule.forRoot()` for IAM-only setups.
191
+
192
+
**Problem:**
193
+
In IAM-only setups (CoreModule.forRoot with only 1 parameter), CoreAuthModule is not imported. CoreAuthModule normally registers the RolesGuard globally. Without this global registration, `@Roles()` decorators are not automatically enforced.
registerRolesGuardGlobally: true, // RolesGuard is registered globally
204
+
}),
205
+
],
206
+
})
207
+
exportclassServerModule {}
208
+
```
209
+
210
+
**When to use:**
211
+
-`registerRolesGuardGlobally: true` - For IAM-only setups (1-parameter CoreModule.forRoot)
212
+
-`registerRolesGuardGlobally: false` (default) - For Legacy + IAM setups (3-parameter CoreModule.forRoot)
213
+
141
214
---
142
215
143
216
## Breaking Changes
@@ -201,6 +274,25 @@ Additionally, new endpoints are available for backup codes.
201
274
202
275
**No action required** - this is a bugfix that improves 2FA functionality without requiring any code changes.
203
276
277
+
### RolesGuard Enforcement in IAM-only Mode
278
+
279
+
**Fixed Issue:** In IAM-only setups (CoreModule.forRoot with 1 parameter), `@Roles()` decorators were not automatically enforced because the RolesGuard was not globally registered.
280
+
281
+
**Symptom:** Endpoints with `@Roles(RoleEnum.ADMIN)` were accessible without authentication.
282
+
283
+
**Cause:** CoreAuthModule (which globally registers the RolesGuard) is not imported in IAM-only setups.
284
+
285
+
**Solution:** Use the new option `registerRolesGuardGlobally: true` in CoreBetterAuthModule.forRoot():
286
+
287
+
```typescript
288
+
CoreBetterAuthModule.forRoot({
289
+
config: environment.betterAuth,
290
+
registerRolesGuardGlobally: true,
291
+
})
292
+
```
293
+
294
+
**Important:** All IAM-only projects should add this option to ensure `@Roles()` decorators are correctly enforced.
Copy file name to clipboardExpand all lines: package.json
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
{
2
2
"name": "@lenne.tech/nest-server",
3
-
"version": "11.10.1",
3
+
"version": "11.10.2",
4
4
"description": "Modern, fast, powerful Node.js web framework in TypeScript based on Nest with a GraphQL API and a connection to MongoDB (or other databases).",
Copy file name to clipboardExpand all lines: spectaql.yml
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -11,7 +11,7 @@ servers:
11
11
info:
12
12
title: lT Nest Server
13
13
description: Modern, fast, powerful Node.js web framework in TypeScript based on Nest with a GraphQL API and a connection to MongoDB (or other databases).
0 commit comments