@loopback/example-access-control-migration 5.0.2 → 5.0.3
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,14 @@
|
|
|
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
|
+
## [5.0.3](https://github.com/loopbackio/loopback-next/compare/@loopback/example-access-control-migration@5.0.2...@loopback/example-access-control-migration@5.0.3) (2022-08-25)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @loopback/example-access-control-migration
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
6
14
|
## [5.0.2](https://github.com/loopbackio/loopback-next/compare/@loopback/example-access-control-migration@5.0.1...@loopback/example-access-control-migration@5.0.2) (2022-07-14)
|
|
7
15
|
|
|
8
16
|
**Note:** Version bump only for package @loopback/example-access-control-migration
|
|
@@ -21,15 +21,13 @@ let UserRepository = class UserRepository extends repository_1.DefaultCrudReposi
|
|
|
21
21
|
this.registerInclusionResolver('userCredentials', this.userCredentials.inclusionResolver);
|
|
22
22
|
}
|
|
23
23
|
async findCredentials(userId) {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
if (err.code === 'ENTITY_NOT_FOUND') {
|
|
24
|
+
return this.userCredentials(userId)
|
|
25
|
+
.get()
|
|
26
|
+
.catch(err => {
|
|
27
|
+
if (err.code === 'ENTITY_NOT_FOUND')
|
|
29
28
|
return undefined;
|
|
30
|
-
}
|
|
31
29
|
throw err;
|
|
32
|
-
}
|
|
30
|
+
});
|
|
33
31
|
}
|
|
34
32
|
};
|
|
35
33
|
UserRepository = tslib_1.__decorate([
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"user.repository.js","sourceRoot":"","sources":["../../src/repositories/user.repository.ts"],"names":[],"mappings":";AAAA,2EAA2E;AAC3E,0DAA0D;AAC1D,+CAA+C;AAC/C,gEAAgE;;;;AAEhE,yCAA8C;AAC9C,qDAK8B;AAC9B,gDAA4C;AAC5C,sCAAqE;AAIrE,IAAa,cAAc,GAA3B,MAAa,cAAe,SAAQ,kCAInC;IAWC,YAC4B,UAAwB,EAExC,+BAAkE,EAElE,oBAA4C;QAEtD,KAAK,CAAC,aAAI,EAAE,UAAU,CAAC,CAAC;QAJd,oCAA+B,GAA/B,+BAA+B,CAAmC;QAElE,yBAAoB,GAApB,oBAAoB,CAAwB;QAGtD,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,iCAAiC,CACjD,OAAO,EACP,oBAAoB,CACrB,CAAC;QACF,IAAI,CAAC,yBAAyB,CAAC,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC;QACtE,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC,gCAAgC,CAC1D,iBAAiB,EACjB,+BAA+B,CAChC,CAAC;QACF,IAAI,CAAC,yBAAyB,CAC5B,iBAAiB,EACjB,IAAI,CAAC,eAAe,CAAC,iBAAiB,CACvC,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,eAAe,CACnB,MAAgC;QAEhC,
|
|
1
|
+
{"version":3,"file":"user.repository.js","sourceRoot":"","sources":["../../src/repositories/user.repository.ts"],"names":[],"mappings":";AAAA,2EAA2E;AAC3E,0DAA0D;AAC1D,+CAA+C;AAC/C,gEAAgE;;;;AAEhE,yCAA8C;AAC9C,qDAK8B;AAC9B,gDAA4C;AAC5C,sCAAqE;AAIrE,IAAa,cAAc,GAA3B,MAAa,cAAe,SAAQ,kCAInC;IAWC,YAC4B,UAAwB,EAExC,+BAAkE,EAElE,oBAA4C;QAEtD,KAAK,CAAC,aAAI,EAAE,UAAU,CAAC,CAAC;QAJd,oCAA+B,GAA/B,+BAA+B,CAAmC;QAElE,yBAAoB,GAApB,oBAAoB,CAAwB;QAGtD,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,iCAAiC,CACjD,OAAO,EACP,oBAAoB,CACrB,CAAC;QACF,IAAI,CAAC,yBAAyB,CAAC,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC,iBAAiB,CAAC,CAAC;QACtE,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC,gCAAgC,CAC1D,iBAAiB,EACjB,+BAA+B,CAChC,CAAC;QACF,IAAI,CAAC,yBAAyB,CAC5B,iBAAiB,EACjB,IAAI,CAAC,eAAe,CAAC,iBAAiB,CACvC,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,eAAe,CACnB,MAAgC;QAEhC,OAAO,IAAI,CAAC,eAAe,CAAC,MAAM,CAAC;aAChC,GAAG,EAAE;aACL,KAAK,CAAC,GAAG,CAAC,EAAE;YACX,IAAI,GAAG,CAAC,IAAI,KAAK,kBAAkB;gBAAE,OAAO,SAAS,CAAC;YACtD,MAAM,GAAG,CAAC;QACZ,CAAC,CAAC,CAAC;IACP,CAAC;CACF,CAAA;AAhDY,cAAc;IAgBtB,mBAAA,IAAA,aAAM,EAAC,gBAAgB,CAAC,CAAA;IACxB,mBAAA,uBAAU,CAAC,MAAM,CAAC,2BAA2B,CAAC,CAAA;IAE9C,mBAAA,uBAAU,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAAA;6CAHE,0BAAY;GAhBzC,cAAc,CAgD1B;AAhDY,wCAAc"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@loopback/example-access-control-migration",
|
|
3
3
|
"description": "Tutorial example on how to migrate the access control example with LoopBack 4.",
|
|
4
|
-
"version": "5.0.
|
|
4
|
+
"version": "5.0.3",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"loopback",
|
|
7
7
|
"LoopBack",
|
|
@@ -51,31 +51,31 @@
|
|
|
51
51
|
"access": "public"
|
|
52
52
|
},
|
|
53
53
|
"dependencies": {
|
|
54
|
-
"@loopback/authentication": "^9.0.
|
|
55
|
-
"@loopback/authorization": "^0.12.
|
|
56
|
-
"@loopback/boot": "^5.0.
|
|
57
|
-
"@loopback/core": "^4.0.
|
|
58
|
-
"@loopback/repository": "^5.0.
|
|
59
|
-
"@loopback/rest": "^12.0.
|
|
60
|
-
"@loopback/rest-explorer": "^5.0.
|
|
61
|
-
"@loopback/security": "^0.8.
|
|
62
|
-
"@loopback/service-proxy": "^5.0.
|
|
54
|
+
"@loopback/authentication": "^9.0.3",
|
|
55
|
+
"@loopback/authorization": "^0.12.3",
|
|
56
|
+
"@loopback/boot": "^5.0.3",
|
|
57
|
+
"@loopback/core": "^4.0.3",
|
|
58
|
+
"@loopback/repository": "^5.0.3",
|
|
59
|
+
"@loopback/rest": "^12.0.3",
|
|
60
|
+
"@loopback/rest-explorer": "^5.0.3",
|
|
61
|
+
"@loopback/security": "^0.8.3",
|
|
62
|
+
"@loopback/service-proxy": "^5.0.3",
|
|
63
63
|
"@types/bcryptjs": "2.4.2",
|
|
64
64
|
"bcryptjs": "^2.4.3",
|
|
65
|
-
"casbin": "^5.
|
|
65
|
+
"casbin": "^5.17.0",
|
|
66
66
|
"jsonwebtoken": "^8.5.1",
|
|
67
67
|
"loopback-connector-rest": "^4.0.1"
|
|
68
68
|
},
|
|
69
69
|
"devDependencies": {
|
|
70
|
-
"@loopback/build": "^9.0.
|
|
71
|
-
"@loopback/eslint-config": "^13.0.
|
|
72
|
-
"@loopback/http-caching-proxy": "^4.0.
|
|
73
|
-
"@loopback/testlab": "^5.0.
|
|
74
|
-
"@types/lodash": "^4.14.
|
|
75
|
-
"@types/node": "^14.18.
|
|
76
|
-
"eslint": "^8.
|
|
70
|
+
"@loopback/build": "^9.0.3",
|
|
71
|
+
"@loopback/eslint-config": "^13.0.3",
|
|
72
|
+
"@loopback/http-caching-proxy": "^4.0.3",
|
|
73
|
+
"@loopback/testlab": "^5.0.3",
|
|
74
|
+
"@types/lodash": "^4.14.184",
|
|
75
|
+
"@types/node": "^14.18.26",
|
|
76
|
+
"eslint": "^8.22.0",
|
|
77
77
|
"lodash": "^4.17.21",
|
|
78
78
|
"typescript": "~4.7.4"
|
|
79
79
|
},
|
|
80
|
-
"gitHead": "
|
|
80
|
+
"gitHead": "296d9a9577fd058d1a2b2386087686cefa65a7a9"
|
|
81
81
|
}
|
|
@@ -56,13 +56,11 @@ export class UserRepository extends DefaultCrudRepository<
|
|
|
56
56
|
async findCredentials(
|
|
57
57
|
userId: typeof User.prototype.id,
|
|
58
58
|
): Promise<UserCredentials | undefined> {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
}
|
|
65
|
-
throw err;
|
|
66
|
-
}
|
|
59
|
+
return this.userCredentials(userId)
|
|
60
|
+
.get()
|
|
61
|
+
.catch(err => {
|
|
62
|
+
if (err.code === 'ENTITY_NOT_FOUND') return undefined;
|
|
63
|
+
throw err;
|
|
64
|
+
});
|
|
67
65
|
}
|
|
68
66
|
}
|