@hugo.ye/common 1.0.105 → 1.0.107
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/build/auth/gql-jwt-auth.guard.d.ts +7 -0
- package/build/auth/gql-jwt-auth.guard.d.ts.map +1 -0
- package/build/auth/gql-jwt-auth.guard.js +20 -0
- package/build/auth/gql-jwt-auth.guard.js.map +1 -0
- package/build/auth/gql-local.guard.d.ts +7 -0
- package/build/auth/gql-local.guard.d.ts.map +1 -0
- package/build/auth/gql-local.guard.js +24 -0
- package/build/auth/gql-local.guard.js.map +1 -0
- package/build/auth/index.d.ts +2 -0
- package/build/auth/index.d.ts.map +1 -1
- package/build/auth/index.js +2 -0
- package/build/auth/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type ExecutionContext } from "@nestjs/common";
|
|
2
|
+
declare const GqlJwtAuthGraud_base: import("@nestjs/passport").Type<import("@nestjs/passport").IAuthGuard>;
|
|
3
|
+
export declare class GqlJwtAuthGraud extends GqlJwtAuthGraud_base {
|
|
4
|
+
getRequest(context: ExecutionContext): any;
|
|
5
|
+
}
|
|
6
|
+
export {};
|
|
7
|
+
//# sourceMappingURL=gql-jwt-auth.guard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gql-jwt-auth.guard.d.ts","sourceRoot":"","sources":["../../src/auth/gql-jwt-auth.guard.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;;AAGnE,qBACa,eAAgB,SAAQ,oBAAgB;IACjD,UAAU,CAAC,OAAO,EAAE,gBAAgB;CAIvC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { Injectable } from "@nestjs/common";
|
|
8
|
+
import { GqlExecutionContext } from "@nestjs/graphql";
|
|
9
|
+
import { AuthGuard } from "@nestjs/passport";
|
|
10
|
+
let GqlJwtAuthGraud = class GqlJwtAuthGraud extends AuthGuard('jwt') {
|
|
11
|
+
getRequest(context) {
|
|
12
|
+
const ctx = GqlExecutionContext.create(context);
|
|
13
|
+
return ctx.getContext().req;
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
GqlJwtAuthGraud = __decorate([
|
|
17
|
+
Injectable()
|
|
18
|
+
], GqlJwtAuthGraud);
|
|
19
|
+
export { GqlJwtAuthGraud };
|
|
20
|
+
//# sourceMappingURL=gql-jwt-auth.guard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gql-jwt-auth.guard.js","sourceRoot":"","sources":["../../src/auth/gql-jwt-auth.guard.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,UAAU,EAAyB,MAAM,gBAAgB,CAAC;AACnE,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAEtC,IAAM,eAAe,GAArB,MAAM,eAAgB,SAAQ,SAAS,CAAC,KAAK,CAAC;IACjD,UAAU,CAAC,OAAyB;QAChC,MAAM,GAAG,GAAG,mBAAmB,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;QAChD,OAAO,GAAG,CAAC,UAAU,EAAE,CAAC,GAAG,CAAC;IAChC,CAAC;CACJ,CAAA;AALY,eAAe;IAD3B,UAAU,EAAE;GACA,eAAe,CAK3B"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type ExecutionContext } from "@nestjs/common";
|
|
2
|
+
declare const GqlLocalGuard_base: import("@nestjs/passport").Type<import("@nestjs/passport").IAuthGuard>;
|
|
3
|
+
export declare class GqlLocalGuard extends GqlLocalGuard_base {
|
|
4
|
+
getRequest(context: ExecutionContext): any;
|
|
5
|
+
}
|
|
6
|
+
export {};
|
|
7
|
+
//# sourceMappingURL=gql-local.guard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gql-local.guard.d.ts","sourceRoot":"","sources":["../../src/auth/gql-local.guard.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,gBAAgB,EAAc,MAAM,gBAAgB,CAAC;;AAInE,qBACa,aAAc,SAAQ,kBAAkB;IACjD,UAAU,CAAC,OAAO,EAAE,gBAAgB;CAQvC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
+
};
|
|
7
|
+
import { Injectable } from "@nestjs/common";
|
|
8
|
+
import { GqlExecutionContext } from "@nestjs/graphql";
|
|
9
|
+
import { AuthGuard } from "@nestjs/passport";
|
|
10
|
+
let GqlLocalGuard = class GqlLocalGuard extends AuthGuard('local') {
|
|
11
|
+
getRequest(context) {
|
|
12
|
+
const gqlExecutionContext = GqlExecutionContext.create(context);
|
|
13
|
+
const gqlContext = gqlExecutionContext.getContext();
|
|
14
|
+
const gqlArgs = gqlExecutionContext.getArgs();
|
|
15
|
+
const { loginInput: { email, password } } = gqlArgs;
|
|
16
|
+
gqlContext.req.body = { ...gqlContext.req.body, email, password }; //:
|
|
17
|
+
return gqlContext.req;
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
GqlLocalGuard = __decorate([
|
|
21
|
+
Injectable()
|
|
22
|
+
], GqlLocalGuard);
|
|
23
|
+
export { GqlLocalGuard };
|
|
24
|
+
//# sourceMappingURL=gql-local.guard.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gql-local.guard.js","sourceRoot":"","sources":["../../src/auth/gql-local.guard.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAyB,UAAU,EAAE,MAAM,gBAAgB,CAAC;AACnE,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAGtC,IAAM,aAAa,GAAnB,MAAM,aAAc,SAAQ,SAAS,CAAC,OAAO,CAAC;IACjD,UAAU,CAAC,OAAyB;QAChC,MAAM,mBAAmB,GAAG,mBAAmB,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;QAChE,MAAM,UAAU,GAAG,mBAAmB,CAAC,UAAU,EAAE,CAAC;QACpD,MAAM,OAAO,GAAG,mBAAmB,CAAC,OAAO,EAAE,CAAC;QAC9C,MAAM,EAAE,UAAU,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,GAAG,OAAO,CAAC;QACpD,UAAU,CAAC,GAAG,CAAC,IAAI,GAAG,EAAE,GAAG,UAAU,CAAC,GAAG,CAAC,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,CAAA,IAAI;QACtE,OAAO,UAAU,CAAC,GAAG,CAAC;IAC1B,CAAC;CACJ,CAAA;AATY,aAAa;IADzB,UAAU,EAAE;GACA,aAAa,CASzB"}
|
package/build/auth/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/auth/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,4BAA4B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/auth/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,yBAAyB,CAAC;AACxC,cAAc,sBAAsB,CAAC"}
|
package/build/auth/index.js
CHANGED
package/build/auth/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/auth/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,4BAA4B,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/auth/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,yBAAyB,CAAC;AACxC,cAAc,sBAAsB,CAAC"}
|