@tsed/passport 8.0.0-beta.4 → 8.0.0-beta.6
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/package.json +8 -8
- package/readme.md +8 -3
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@tsed/passport",
|
|
3
3
|
"description": "Passport package for Ts.ED framework",
|
|
4
4
|
"type": "module",
|
|
5
|
-
"version": "8.0.0-beta.
|
|
5
|
+
"version": "8.0.0-beta.6",
|
|
6
6
|
"source": "./src/index.ts",
|
|
7
7
|
"main": "./lib/esm/index.js",
|
|
8
8
|
"module": "./lib/esm/index.js",
|
|
@@ -27,12 +27,12 @@
|
|
|
27
27
|
"tslib": "2.7.0"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
|
-
"@tsed/barrels": "8.0.0-beta.
|
|
31
|
-
"@tsed/core": "8.0.0-beta.
|
|
32
|
-
"@tsed/di": "8.0.0-beta.
|
|
33
|
-
"@tsed/platform-http": "8.0.0-beta.
|
|
34
|
-
"@tsed/platform-router": "8.0.0-beta.
|
|
35
|
-
"@tsed/typescript": "8.0.0-beta.
|
|
30
|
+
"@tsed/barrels": "8.0.0-beta.6",
|
|
31
|
+
"@tsed/core": "8.0.0-beta.6",
|
|
32
|
+
"@tsed/di": "8.0.0-beta.6",
|
|
33
|
+
"@tsed/platform-http": "8.0.0-beta.6",
|
|
34
|
+
"@tsed/platform-router": "8.0.0-beta.6",
|
|
35
|
+
"@tsed/typescript": "8.0.0-beta.6",
|
|
36
36
|
"@types/passport": "1.0.16",
|
|
37
37
|
"@types/passport-http": "0.3.11",
|
|
38
38
|
"@types/passport-local": "1.0.38",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"vitest": "2.1.2"
|
|
47
47
|
},
|
|
48
48
|
"peerDependencies": {
|
|
49
|
-
"@tsed/platform-http": "8.0.0-beta.
|
|
49
|
+
"@tsed/platform-http": "8.0.0-beta.6",
|
|
50
50
|
"passport": ">=0.4.1"
|
|
51
51
|
},
|
|
52
52
|
"peerDependenciesMeta": {
|
package/readme.md
CHANGED
|
@@ -43,7 +43,7 @@ npm install --save-dev @types/passport
|
|
|
43
43
|
Add this configuration to your server:
|
|
44
44
|
|
|
45
45
|
```typescript
|
|
46
|
-
import {Configuration} from "@tsed/
|
|
46
|
+
import {Configuration} from "@tsed/di";
|
|
47
47
|
|
|
48
48
|
@Configuration({
|
|
49
49
|
componentsScan: [
|
|
@@ -61,7 +61,9 @@ A Protocol is a special Ts.ED service which is used to declare a Passport Strate
|
|
|
61
61
|
Here an example with the PassportLocal:
|
|
62
62
|
|
|
63
63
|
```typescript
|
|
64
|
-
import {BodyParams
|
|
64
|
+
import {BodyParams} from "@tsed/platform-params";
|
|
65
|
+
import {Format, Required} from "@tsed/schema";
|
|
66
|
+
import {Req} from "@tsed/platform-http";
|
|
65
67
|
import {Strategy} from "passport-local";
|
|
66
68
|
import {Unauthorized} from "@tsed/exceptions";
|
|
67
69
|
import {Protocol, OnInstall, OnVerify} from "@tsed/passport";
|
|
@@ -114,7 +116,10 @@ export class LocalProtocol implements OnVerify, OnInstall {
|
|
|
114
116
|
Create a new Passport controller as following:
|
|
115
117
|
|
|
116
118
|
```typescript
|
|
117
|
-
import {BodyParams
|
|
119
|
+
import {BodyParams} from "@tsed/platform-params";
|
|
120
|
+
import {Req} from "@tsed/platform-http";
|
|
121
|
+
import {Get, Post} from "@tsed/schema";
|
|
122
|
+
import {Controller, ProviderScope, Scope} from "@tsed/di";
|
|
118
123
|
import {Authenticate} from "@tsed/passport";
|
|
119
124
|
|
|
120
125
|
@Controller("/")
|