@rxap/nest-auth0 11.0.0-dev.3 → 11.0.0-dev.4

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/CHANGELOG.md CHANGED
@@ -3,6 +3,12 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # [11.0.0-dev.4](https://gitlab.com/rxap/packages/compare/@rxap/nest-auth0@11.0.0-dev.3...@rxap/nest-auth0@11.0.0-dev.4) (2025-08-27)
7
+
8
+ ### Features
9
+
10
+ - **auth0:** add bypass functionality to Auth0 guard ([6187a89](https://gitlab.com/rxap/packages/commit/6187a89800991dfdca7c6a625f61b07fe4275508))
11
+
6
12
  # [11.0.0-dev.3](https://gitlab.com/rxap/packages/compare/@rxap/nest-auth0@11.0.0-dev.2...@rxap/nest-auth0@11.0.0-dev.3) (2025-07-23)
7
13
 
8
14
  ### Bug Fixes
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "11.0.0-dev.3",
2
+ "version": "11.0.0-dev.4",
3
3
  "name": "@rxap/nest-auth0",
4
4
  "description": "This package provides an Auth0 module for NestJS applications, simplifying integration with Auth0 for authentication and authorization. It includes a configurable module, JWT strategy, and service for interacting with the Auth0 Authentication API. The module also offers validation schemas for environment variables related to Auth0 configuration.\n",
5
5
  "license": "GPL-3.0-or-later",
@@ -12,7 +12,7 @@
12
12
  "@nestjs/config": "^4.0.2",
13
13
  "@nestjs/core": "^11.1.1",
14
14
  "@nestjs/jwt": "^11.0.0",
15
- "@rxap/nest-utilities": "^11.0.0-dev.2",
15
+ "@rxap/nest-utilities": "^11.0.0-dev.5",
16
16
  "auth0": "^4.18.0",
17
17
  "joi": "^17.9.2",
18
18
  "jsonwebtoken": "*",
@@ -48,5 +48,5 @@
48
48
  "schematics": "./generators.json",
49
49
  "type": "commonjs",
50
50
  "types": "./src/index.d.ts",
51
- "gitHead": "e0b7848b937362c1358030aad59aac5096b196a7"
51
+ "gitHead": "cbae1545fd039123b9ba59679d04960483eb8ead"
52
52
  }
package/src/index.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  export * from './lib/auth0-authentication.service';
2
+ export * from './lib/auth0-bypass';
2
3
  export * from './lib/auth0-management.service';
3
4
  export * from './lib/auth0-module-options.factory';
4
5
  export * from './lib/auth0-options';
package/src/index.js CHANGED
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
4
  // region
5
5
  tslib_1.__exportStar(require("./lib/auth0-authentication.service"), exports);
6
+ tslib_1.__exportStar(require("./lib/auth0-bypass"), exports);
6
7
  tslib_1.__exportStar(require("./lib/auth0-management.service"), exports);
7
8
  tslib_1.__exportStar(require("./lib/auth0-module-options.factory"), exports);
8
9
  tslib_1.__exportStar(require("./lib/auth0-options"), exports);
@@ -0,0 +1,2 @@
1
+ export declare const AUTH0_BYPASS_KEY = "auth0-bypass";
2
+ export declare const Auth0Bypass: () => import("@nestjs/common").CustomDecorator<string>;
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Auth0Bypass = exports.AUTH0_BYPASS_KEY = void 0;
4
+ const common_1 = require("@nestjs/common");
5
+ exports.AUTH0_BYPASS_KEY = 'auth0-bypass';
6
+ const Auth0Bypass = () => (0, common_1.SetMetadata)(exports.AUTH0_BYPASS_KEY, true);
7
+ exports.Auth0Bypass = Auth0Bypass;
@@ -7,6 +7,7 @@ const core_1 = require("@nestjs/core");
7
7
  const jwt_1 = require("@nestjs/jwt");
8
8
  const nest_utilities_1 = require("@rxap/nest-utilities");
9
9
  const passport_jwt_1 = require("passport-jwt");
10
+ const auth0_bypass_1 = require("./auth0-bypass");
10
11
  const tokens_1 = require("./tokens");
11
12
  let Auth0Guard = class Auth0Guard {
12
13
  async canActivate(context) {
@@ -17,6 +18,13 @@ let Auth0Guard = class Auth0Guard {
17
18
  if (isPublic) {
18
19
  return true;
19
20
  }
21
+ const auth0Bypass = this.reflector.getAllAndOverride(auth0_bypass_1.AUTH0_BYPASS_KEY, [
22
+ context.getHandler(),
23
+ context.getClass(),
24
+ ]);
25
+ if (auth0Bypass) {
26
+ return true;
27
+ }
20
28
  const request = context.switchToHttp().getRequest();
21
29
  if (this.options.disabled) {
22
30
  this.logger.warn('Auth0 is disabled', 'Auth0Guard');