itlab-internal-services 2.16.11 → 2.16.12

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.
@@ -9,4 +9,4 @@
9
9
  * @throws {UnprocessableEntityException} When the 'Authorization' header is missing.
10
10
  * @returns {string} The extracted JWT token without the 'Bearer ' prefix.
11
11
  */
12
- export declare function Jwt(): ParameterDecorator;
12
+ export declare const Jwt: (...dataOrPipes: any[]) => ParameterDecorator;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Jwt = Jwt;
3
+ exports.Jwt = void 0;
4
4
  const common_1 = require("@nestjs/common");
5
5
  /**
6
6
  * Custom decorator to extract the JWT token from the request headers.
@@ -13,15 +13,13 @@ const common_1 = require("@nestjs/common");
13
13
  * @throws {UnprocessableEntityException} When the 'Authorization' header is missing.
14
14
  * @returns {string} The extracted JWT token without the 'Bearer ' prefix.
15
15
  */
16
- function Jwt() {
17
- return (0, common_1.createParamDecorator)((_, executionContext) => {
18
- const request = executionContext.switchToHttp().getRequest();
19
- const authHeader = request.header('Authorization');
20
- if (!authHeader) {
21
- throw new common_1.UnprocessableEntityException('Authorization header is missing from the request');
22
- }
23
- // Extract token by removing the 'Bearer ' prefix (case-insensitive)
24
- const token = authHeader.replace(/^Bearer\s+/i, '');
25
- return token;
26
- });
27
- }
16
+ exports.Jwt = (0, common_1.createParamDecorator)((_, executionContext) => {
17
+ const request = executionContext.switchToHttp().getRequest();
18
+ const authHeader = request.header('Authorization');
19
+ if (!authHeader) {
20
+ throw new common_1.UnprocessableEntityException('Authorization header is missing from the request');
21
+ }
22
+ // Extract token by removing the 'Bearer ' prefix (case-insensitive)
23
+ const token = authHeader.replace(/^Bearer\s+/i, '');
24
+ return token;
25
+ });
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "name": "Timo Scheuermann",
5
5
  "email": "timo.scheuermann@sv-informatik.de"
6
6
  },
7
- "version": "2.16.11",
7
+ "version": "2.16.12",
8
8
  "type": "commonjs",
9
9
  "files": [
10
10
  "dist"