@nest-boot/auth 7.9.4 → 7.9.5
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/auth.guard.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CanActivate, ExecutionContext } from "@nestjs/common";
|
|
1
|
+
import { type CanActivate, type ExecutionContext } from "@nestjs/common";
|
|
2
2
|
import { Reflector } from "@nestjs/core";
|
|
3
3
|
/**
|
|
4
4
|
* Guard that enforces authentication on routes.
|
|
@@ -16,7 +16,7 @@ export declare class AuthGuard implements CanActivate {
|
|
|
16
16
|
/**
|
|
17
17
|
* Determines whether the current request is allowed to proceed.
|
|
18
18
|
* @param context - The execution context of the current request
|
|
19
|
-
* @returns
|
|
19
|
+
* @returns A NestJS guard activation result
|
|
20
20
|
*/
|
|
21
|
-
canActivate(context: ExecutionContext):
|
|
21
|
+
canActivate(context: ExecutionContext): ReturnType<CanActivate["canActivate"]>;
|
|
22
22
|
}
|
package/dist/auth.guard.js
CHANGED
|
@@ -32,7 +32,7 @@ let AuthGuard = class AuthGuard {
|
|
|
32
32
|
/**
|
|
33
33
|
* Determines whether the current request is allowed to proceed.
|
|
34
34
|
* @param context - The execution context of the current request
|
|
35
|
-
* @returns
|
|
35
|
+
* @returns A NestJS guard activation result
|
|
36
36
|
*/
|
|
37
37
|
canActivate(context) {
|
|
38
38
|
if (this.reflector.getAllAndOverride(auth_constants_1.IS_PUBLIC_KEY, [
|
package/dist/auth.guard.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"auth.guard.js","sourceRoot":"","sources":["../src/auth.guard.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,gEAA4D;AAC5D,
|
|
1
|
+
{"version":3,"file":"auth.guard.js","sourceRoot":"","sources":["../src/auth.guard.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,gEAA4D;AAC5D,2CAIwB;AACxB,uCAAyC;AAEzC,qDAAiD;AACjD,8DAAwD;AAExD;;;;;;GAMG;AAEI,IAAM,SAAS,GAAf,MAAM,SAAS;IACpB;;OAEG;IACH,YAA+B,SAAoB;QAApB,cAAS,GAAT,SAAS,CAAW;IAAG,CAAC;IAEvD;;;;OAIG;IACH,WAAW,CACT,OAAyB;QAEzB,IACE,IAAI,CAAC,SAAS,CAAC,iBAAiB,CAAU,8BAAa,EAAE;YACvD,OAAO,CAAC,UAAU,EAAE;YACpB,OAAO,CAAC,QAAQ,EAAE;SACnB,CAAC,EACF,CAAC;YACD,OAAO,IAAI,CAAC;QACd,CAAC;QAED,OAAO,CAAC,CAAC,gCAAc,CAAC,GAAG,CAAC,4BAAW,CAAC,CAAC;IAC3C,CAAC;CACF,CAAA;AAzBY,8BAAS;oBAAT,SAAS;IADrB,IAAA,mBAAU,GAAE;qCAK+B,gBAAS;GAJxC,SAAS,CAyBrB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const rxjs_1 = require("rxjs");
|
|
4
|
+
const auth_guard_1 = require("./auth.guard");
|
|
5
|
+
class PromiseAuthGuard extends auth_guard_1.AuthGuard {
|
|
6
|
+
canActivate(_context) {
|
|
7
|
+
return Promise.resolve(true);
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
class ObservableAuthGuard extends auth_guard_1.AuthGuard {
|
|
11
|
+
canActivate(_context) {
|
|
12
|
+
return (0, rxjs_1.of)(true);
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
describe("AuthGuard", () => {
|
|
16
|
+
it("allows subclasses to return the full CanActivate result type", () => {
|
|
17
|
+
expect(PromiseAuthGuard).toBeDefined();
|
|
18
|
+
expect(ObservableAuthGuard).toBeDefined();
|
|
19
|
+
});
|
|
20
|
+
});
|
|
21
|
+
//# sourceMappingURL=auth.guard.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auth.guard.spec.js","sourceRoot":"","sources":["../src/auth.guard.spec.ts"],"names":[],"mappings":";;AACA,+BAA0B;AAE1B,6CAAyC;AAEzC,MAAM,gBAAiB,SAAQ,sBAAS;IAC7B,WAAW,CAClB,QAA0B;QAE1B,OAAO,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IAC/B,CAAC;CACF;AAED,MAAM,mBAAoB,SAAQ,sBAAS;IAChC,WAAW,CAClB,QAA0B;QAE1B,OAAO,IAAA,SAAE,EAAC,IAAI,CAAC,CAAC;IAClB,CAAC;CACF;AAED,QAAQ,CAAC,WAAW,EAAE,GAAG,EAAE;IACzB,EAAE,CAAC,8DAA8D,EAAE,GAAG,EAAE;QACtE,MAAM,CAAC,gBAAgB,CAAC,CAAC,WAAW,EAAE,CAAC;QACvC,MAAM,CAAC,mBAAmB,CAAC,CAAC,WAAW,EAAE,CAAC;IAC5C,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|