@lenne.tech/nest-server 9.2.0 → 9.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/core/common/interceptors/check-security.interceptor.js +1 -2
- package/dist/core/common/interceptors/check-security.interceptor.js.map +1 -1
- package/dist/core/modules/file/core-file.controller.d.ts +2 -2
- package/dist/core/modules/file/core-file.controller.js +2 -2
- package/dist/core/modules/file/core-file.controller.js.map +1 -1
- package/dist/core/modules/user/core-user.model.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/core/common/interceptors/check-security.interceptor.ts +3 -2
- package/src/core/modules/file/core-file.controller.ts +2 -2
- package/src/core/modules/user/core-user.model.ts +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lenne.tech/nest-server",
|
|
3
|
-
"version": "9.2.
|
|
3
|
+
"version": "9.2.1",
|
|
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).",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"node",
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { Injectable, NestInterceptor, ExecutionContext, CallHandler } from '@nestjs/common';
|
|
2
2
|
import { Observable } from 'rxjs';
|
|
3
3
|
import { map } from 'rxjs/operators';
|
|
4
|
-
import { AuthResolver } from '../../../server/modules/auth/auth.resolver';
|
|
5
4
|
import { getContextData } from '../helpers/context.helper';
|
|
6
5
|
import { processDeep } from '../helpers/input.helper';
|
|
7
6
|
|
|
@@ -17,7 +16,9 @@ export class CheckSecurityInterceptor implements NestInterceptor {
|
|
|
17
16
|
// Set force mode for sign in and sign up
|
|
18
17
|
let force = false;
|
|
19
18
|
if (!user) {
|
|
20
|
-
|
|
19
|
+
// Here the name is used and not the class itself, because the concrete class is located in the respective project.
|
|
20
|
+
// In case of an override it is better to use the concrete class directly (context.getClass() instead of context.getClasss()?.name).
|
|
21
|
+
if (context.getClass()?.name === 'AuthResolver') {
|
|
21
22
|
force = true;
|
|
22
23
|
}
|
|
23
24
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BadRequestException, Controller, Get, NotFoundException, Param, Res } from '@nestjs/common';
|
|
2
|
-
import { User } from '../../../server/modules/user/user.model';
|
|
3
2
|
import { RESTUser } from '../../common/decorators/rest-user.decorator';
|
|
3
|
+
import { CoreUserModel } from '../user/core-user.model';
|
|
4
4
|
import { CoreFileService } from './core-file.service';
|
|
5
5
|
|
|
6
6
|
/**
|
|
@@ -17,7 +17,7 @@ export abstract class CoreFileController {
|
|
|
17
17
|
* Download file
|
|
18
18
|
*/
|
|
19
19
|
@Get(':filename')
|
|
20
|
-
async getFile(@Param('filename') filename: string, @Res() res, @RESTUser() user:
|
|
20
|
+
async getFile(@Param('filename') filename: string, @Res() res, @RESTUser() user: CoreUserModel) {
|
|
21
21
|
if (!filename) {
|
|
22
22
|
throw new BadRequestException('Missing filename for download');
|
|
23
23
|
}
|
|
@@ -2,7 +2,6 @@ import { Field, ObjectType } from '@nestjs/graphql';
|
|
|
2
2
|
import { Prop, raw, Schema as MongooseSchema } from '@nestjs/mongoose';
|
|
3
3
|
import { IsEmail, IsOptional } from 'class-validator';
|
|
4
4
|
import { Document } from 'mongoose';
|
|
5
|
-
import { User } from '../../../server/modules/user/user.model';
|
|
6
5
|
import { CorePersistenceModel } from '../../common/models/core-persistence.model';
|
|
7
6
|
|
|
8
7
|
export type CoreUserModelDocument = CoreUserModel & Document;
|