@loopback/example-passport-login 4.0.0 → 4.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 +24 -0
- package/LICENSE +2 -2
- package/dist/__tests__/acceptance/passport-login.acceptance.js +1 -1
- package/dist/__tests__/acceptance/passport-login.acceptance.js.map +1 -1
- package/dist/application.d.ts +3 -3
- package/dist/application.js +1 -1
- package/dist/application.js.map +1 -1
- package/dist/authentication-interceptors/facebook.interceptor.d.ts +1 -1
- package/dist/authentication-interceptors/facebook.interceptor.js +1 -1
- package/dist/authentication-interceptors/facebook.interceptor.js.map +1 -1
- package/dist/authentication-interceptors/google.interceptor.d.ts +1 -1
- package/dist/authentication-interceptors/google.interceptor.js +1 -1
- package/dist/authentication-interceptors/google.interceptor.js.map +1 -1
- package/dist/authentication-interceptors/index.js +1 -1
- package/dist/authentication-interceptors/index.js.map +1 -1
- package/dist/authentication-interceptors/oauth2.interceptor.d.ts +1 -1
- package/dist/authentication-interceptors/oauth2.interceptor.js +1 -1
- package/dist/authentication-interceptors/oauth2.interceptor.js.map +1 -1
- package/dist/authentication-interceptors/session.interceptor.d.ts +1 -1
- package/dist/authentication-interceptors/session.interceptor.js +1 -1
- package/dist/authentication-interceptors/session.interceptor.js.map +1 -1
- package/dist/authentication-interceptors/twitter.interceptor.js +1 -1
- package/dist/authentication-interceptors/twitter.interceptor.js.map +1 -1
- package/dist/authentication-interceptors/types.js +1 -1
- package/dist/authentication-interceptors/types.js.map +1 -1
- package/dist/authentication-strategies/basic.js +2 -2
- package/dist/authentication-strategies/basic.js.map +1 -1
- package/dist/authentication-strategies/facebook.js +1 -1
- package/dist/authentication-strategies/facebook.js.map +1 -1
- package/dist/authentication-strategies/google.js +1 -1
- package/dist/authentication-strategies/google.js.map +1 -1
- package/dist/authentication-strategies/index.js +1 -1
- package/dist/authentication-strategies/index.js.map +1 -1
- package/dist/authentication-strategies/local.js +2 -2
- package/dist/authentication-strategies/local.js.map +1 -1
- package/dist/authentication-strategies/oauth2.js +1 -1
- package/dist/authentication-strategies/oauth2.js.map +1 -1
- package/dist/authentication-strategies/session.js +4 -3
- package/dist/authentication-strategies/session.js.map +1 -1
- package/dist/authentication-strategies/twitter.js +1 -1
- package/dist/authentication-strategies/twitter.js.map +1 -1
- package/dist/authentication-strategies/types.d.ts +2 -2
- package/dist/authentication-strategies/types.js +2 -2
- package/dist/authentication-strategies/types.js.map +1 -1
- package/dist/authentication-strategy-providers/facebook.express-mw.js +1 -1
- package/dist/authentication-strategy-providers/facebook.express-mw.js.map +1 -1
- package/dist/authentication-strategy-providers/facebook.js +1 -1
- package/dist/authentication-strategy-providers/facebook.js.map +1 -1
- package/dist/authentication-strategy-providers/google.express-mw.js +1 -1
- package/dist/authentication-strategy-providers/google.express-mw.js.map +1 -1
- package/dist/authentication-strategy-providers/google.js +1 -1
- package/dist/authentication-strategy-providers/google.js.map +1 -1
- package/dist/authentication-strategy-providers/index.js +1 -1
- package/dist/authentication-strategy-providers/index.js.map +1 -1
- package/dist/authentication-strategy-providers/oauth2.express-mw.js +1 -1
- package/dist/authentication-strategy-providers/oauth2.express-mw.js.map +1 -1
- package/dist/authentication-strategy-providers/oauth2.js +1 -1
- package/dist/authentication-strategy-providers/oauth2.js.map +1 -1
- package/dist/authentication-strategy-providers/twitter.express-mw.js +1 -1
- package/dist/authentication-strategy-providers/twitter.express-mw.js.map +1 -1
- package/dist/authentication-strategy-providers/twitter.js +1 -1
- package/dist/authentication-strategy-providers/twitter.js.map +1 -1
- package/dist/controllers/index.d.ts +1 -1
- package/dist/controllers/index.js +2 -2
- package/dist/controllers/index.js.map +1 -1
- package/dist/controllers/oauth2.controller.d.ts +1 -1
- package/dist/controllers/oauth2.controller.js +2 -2
- package/dist/controllers/oauth2.controller.js.map +1 -1
- package/dist/controllers/ping.controller.js +3 -3
- package/dist/controllers/ping.controller.js.map +1 -1
- package/dist/controllers/user.controller.js +1 -1
- package/dist/controllers/user.controller.js.map +1 -1
- package/dist/datasources/db.datasource.js +1 -1
- package/dist/datasources/db.datasource.js.map +1 -1
- package/dist/datasources/index.js +1 -1
- package/dist/datasources/index.js.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/model-endpoints/index.js +1 -1
- package/dist/model-endpoints/index.js.map +1 -1
- package/dist/model-endpoints/user.rest-config.js +1 -1
- package/dist/model-endpoints/user.rest-config.js.map +1 -1
- package/dist/models/index.d.ts +1 -1
- package/dist/models/index.js +2 -2
- package/dist/models/index.js.map +1 -1
- package/dist/models/user-credentials.model.js +1 -1
- package/dist/models/user-credentials.model.js.map +1 -1
- package/dist/models/user-identity.model.js +1 -1
- package/dist/models/user-identity.model.js.map +1 -1
- package/dist/models/user.model.js +1 -1
- package/dist/models/user.model.js.map +1 -1
- package/dist/observers/index.js +1 -1
- package/dist/observers/index.js.map +1 -1
- package/dist/observers/wire.observer.js +1 -1
- package/dist/observers/wire.observer.js.map +1 -1
- package/dist/repositories/index.js +1 -1
- package/dist/repositories/index.js.map +1 -1
- package/dist/repositories/user-credentials.repository.d.ts +1 -1
- package/dist/repositories/user-credentials.repository.js +3 -3
- package/dist/repositories/user-credentials.repository.js.map +1 -1
- package/dist/repositories/user-identity.repository.d.ts +1 -1
- package/dist/repositories/user-identity.repository.js +3 -3
- package/dist/repositories/user-identity.repository.js.map +1 -1
- package/dist/repositories/user.repository.d.ts +2 -2
- package/dist/repositories/user.repository.js +1 -1
- package/dist/repositories/user.repository.js.map +1 -1
- package/dist/sequence.js +1 -1
- package/dist/sequence.js.map +1 -1
- package/dist/server.js +1 -1
- package/dist/server.js.map +1 -1
- package/dist/services/index.d.ts +1 -1
- package/dist/services/index.js +2 -2
- package/dist/services/index.js.map +1 -1
- package/dist/services/keys.d.ts +1 -1
- package/dist/services/keys.js +1 -1
- package/dist/services/keys.js.map +1 -1
- package/dist/services/user.service.js +5 -5
- package/dist/services/user.service.js.map +1 -1
- package/dist/wiring.js +1 -1
- package/dist/wiring.js.map +1 -1
- package/package.json +28 -28
- package/src/__tests__/acceptance/passport-login.acceptance.ts +1 -1
- package/src/application.ts +1 -1
- package/src/authentication-interceptors/facebook.interceptor.ts +4 -4
- package/src/authentication-interceptors/google.interceptor.ts +4 -4
- package/src/authentication-interceptors/index.ts +1 -1
- package/src/authentication-interceptors/oauth2.interceptor.ts +5 -5
- package/src/authentication-interceptors/session.interceptor.ts +3 -3
- package/src/authentication-interceptors/twitter.interceptor.ts +1 -1
- package/src/authentication-interceptors/types.ts +1 -1
- package/src/authentication-strategies/basic.ts +2 -2
- package/src/authentication-strategies/facebook.ts +1 -1
- package/src/authentication-strategies/google.ts +1 -1
- package/src/authentication-strategies/index.ts +1 -1
- package/src/authentication-strategies/local.ts +2 -2
- package/src/authentication-strategies/oauth2.ts +1 -1
- package/src/authentication-strategies/session.ts +3 -3
- package/src/authentication-strategies/twitter.ts +1 -1
- package/src/authentication-strategies/types.ts +3 -3
- package/src/authentication-strategy-providers/facebook.express-mw.ts +1 -1
- package/src/authentication-strategy-providers/facebook.ts +1 -1
- package/src/authentication-strategy-providers/google.express-mw.ts +1 -1
- package/src/authentication-strategy-providers/google.ts +1 -1
- package/src/authentication-strategy-providers/index.ts +1 -1
- package/src/authentication-strategy-providers/oauth2.express-mw.ts +1 -1
- package/src/authentication-strategy-providers/oauth2.ts +1 -1
- package/src/authentication-strategy-providers/twitter.express-mw.ts +1 -1
- package/src/authentication-strategy-providers/twitter.ts +1 -1
- package/src/controllers/index.ts +2 -2
- package/src/controllers/oauth2.controller.ts +6 -6
- package/src/controllers/ping.controller.ts +5 -5
- package/src/controllers/user.controller.ts +1 -1
- package/src/datasources/db.datasource.ts +1 -1
- package/src/datasources/index.ts +1 -1
- package/src/index.ts +1 -1
- package/src/model-endpoints/index.ts +1 -1
- package/src/model-endpoints/user.rest-config.ts +1 -1
- package/src/models/index.ts +2 -2
- package/src/models/user-credentials.model.ts +1 -1
- package/src/models/user-identity.model.ts +2 -2
- package/src/models/user.model.ts +2 -2
- package/src/observers/index.ts +1 -1
- package/src/observers/wire.observer.ts +1 -1
- package/src/repositories/index.ts +1 -1
- package/src/repositories/user-credentials.repository.ts +3 -3
- package/src/repositories/user-identity.repository.ts +3 -3
- package/src/repositories/user.repository.ts +5 -5
- package/src/sequence.ts +1 -1
- package/src/server.ts +1 -1
- package/src/services/index.ts +2 -2
- package/src/services/keys.ts +2 -2
- package/src/services/user.service.ts +3 -3
- package/src/wiring.ts +1 -1
- package/web-application/express-app.js +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
// Copyright IBM Corp. 2020. All Rights Reserved.
|
|
2
|
+
// Copyright IBM Corp. and LoopBack contributors 2020. All Rights Reserved.
|
|
3
3
|
// Node module: @loopback/example-passport-login
|
|
4
4
|
// This file is licensed under the MIT License.
|
|
5
5
|
// License text available at https://opensource.org/licenses/MIT
|
|
@@ -25,8 +25,8 @@ let PassportUserIdentityService = class PassportUserIdentityService {
|
|
|
25
25
|
* @param token
|
|
26
26
|
*/
|
|
27
27
|
async findOrCreateUser(profile) {
|
|
28
|
-
var _a;
|
|
29
|
-
if (!profile
|
|
28
|
+
var _a, _b;
|
|
29
|
+
if (!((_a = profile === null || profile === void 0 ? void 0 : profile.emails) === null || _a === void 0 ? void 0 : _a.length)) {
|
|
30
30
|
throw new Error('email-id is required in returned profile to login');
|
|
31
31
|
}
|
|
32
32
|
const email = profile.emails[0].value;
|
|
@@ -36,8 +36,8 @@ let PassportUserIdentityService = class PassportUserIdentityService {
|
|
|
36
36
|
},
|
|
37
37
|
});
|
|
38
38
|
let user;
|
|
39
|
-
if (!users ||
|
|
40
|
-
const name = ((
|
|
39
|
+
if (!(users === null || users === void 0 ? void 0 : users.length)) {
|
|
40
|
+
const name = ((_b = profile.name) === null || _b === void 0 ? void 0 : _b.givenName)
|
|
41
41
|
? profile.name.givenName + ' ' + profile.name.familyName
|
|
42
42
|
: profile.displayName;
|
|
43
43
|
user = await this.userRepository.create({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"user.service.js","sourceRoot":"","sources":["../../src/services/user.service.ts"],"names":[],"mappings":";AAAA,
|
|
1
|
+
{"version":3,"file":"user.service.js","sourceRoot":"","sources":["../../src/services/user.service.ts"],"names":[],"mappings":"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"}
|
package/dist/wiring.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
// Copyright IBM Corp. 2020. All Rights Reserved.
|
|
2
|
+
// Copyright IBM Corp. and LoopBack contributors 2020. All Rights Reserved.
|
|
3
3
|
// Node module: @loopback/example-passport-login
|
|
4
4
|
// This file is licensed under the MIT License.
|
|
5
5
|
// License text available at https://opensource.org/licenses/MIT
|
package/dist/wiring.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wiring.js","sourceRoot":"","sources":["../src/wiring.ts"],"names":[],"mappings":";AAAA,
|
|
1
|
+
{"version":3,"file":"wiring.js","sourceRoot":"","sources":["../src/wiring.ts"],"names":[],"mappings":";AAAA,2EAA2E;AAC3E,gDAAgD;AAChD,+CAA+C;AAC/C,gEAAgE;;;;AAEhE,yCAKwB;AACxB,yCAAoE;AACpE,gEAAgC;AAChC,+EAMuC;AACvC,2EAQqC;AACrC,2FAS6C;AAC7C,yCAA4E;AAE5E,SAAgB,aAAa,CAAC,GAAgB;IAC5C,8DAA8D;IAC9D,kBAAQ,CAAC,aAAa,CAAC,UAAU,IAAS,EAAE,IAAI;QAC9C,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IACnB,CAAC,CAAC,CAAC;IACH,8DAA8D;IAC9D,kBAAQ,CAAC,eAAe,CAAC,UAAU,IAAS,EAAE,IAAI;QAChD,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IACnB,CAAC,CAAC,CAAC;IACH,GAAG;SACA,IAAI,CAAC,8BAAmB,CAAC,8BAA8B,CAAC;SACxD,OAAO,CAAC,sCAA2B,CAAC,CAAC;IAExC,sBAAsB;IACtB,MAAM,kBAAkB,GAAyC;QAC/D,gBAAgB,EAAE,iDAAa;QAC/B,cAAc,EAAE,+CAAW;QAC3B,eAAe,EAAE,gDAAY;QAC7B,cAAc,EAAE,gDAAY;KAC7B,CAAC;IACF,KAAK,MAAM,GAAG,IAAI,kBAAkB,EAAE;QACpC,GAAG,CAAC,GAAG,CAAC,IAAA,6BAAsB,EAAC,kBAAkB,CAAC,GAAG,CAAC,EAAE,EAAC,GAAG,EAAC,CAAC,CAAC,CAAC;KACjE;IAED,8BAA8B;IAC9B,MAAM,aAAa,GAGf;QACF,0BAA0B,EAAE,mEAA+B;QAC3D,wBAAwB,EAAE,iEAA6B;QACvD,yBAAyB,EAAE,iEAA6B;QACxD,wBAAwB,EAAE,iEAA6B;KACxD,CAAC;IACF,KAAK,MAAM,GAAG,IAAI,aAAa,EAAE;QAC/B,GAAG,CAAC,GAAG,CAAC,IAAA,6BAAsB,EAAC,aAAa,CAAC,GAAG,CAAC,EAAE,EAAC,GAAG,EAAC,CAAC,CAAC,CAAC;KAC5D;IAED,6CAA6C;IAC7C,MAAM,UAAU,GAA2B;QACzC,6CAAiB;QACjB,wDAA4B;QAC5B,sDAA0B;QAC1B,sDAA0B;QAC1B,8CAAkB;QAClB,2CAAe;QACf,yCAAa;KACd,CAAC;IACF,KAAK,MAAM,CAAC,IAAI,UAAU,EAAE;QAC1B,GAAG,CAAC,GAAG,CAAC,IAAA,6BAAsB,EAAC,CAAC,CAAC,CAAC,CAAC;KACpC;IAED,wCAAwC;IACxC,GAAG,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC,EAAE,CAAC,IAAA,oBAAa,EAAC,kBAAQ,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC;IACtE,GAAG,CAAC,IAAI,CAAC,qBAAqB,CAAC,CAAC,EAAE,CAAC,IAAA,oBAAa,EAAC,kBAAQ,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;IACtE,GAAG,CAAC,IAAI,CAAC,mBAAmB,CAAC,CAAC,UAAU,CAAC,sDAAwB,CAAC,CAAC;IACnE,GAAG,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC,UAAU,CAAC,oDAAsB,CAAC,CAAC;IAC/D,GAAG,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC,UAAU,CAAC,qDAAuB,CAAC,CAAC;IACjE,GAAG,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC,UAAU,CAAC,qDAAuB,CAAC,CAAC;IAChE,GAAG,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC,UAAU,CAAC,yCAAW,CAAC,CAAC;AACvD,CAAC;AA5DD,sCA4DC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@loopback/example-passport-login",
|
|
3
3
|
"description": "An example to demonstrate authentication with passport strategies",
|
|
4
|
-
"version": "4.0.
|
|
4
|
+
"version": "4.0.3",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"loopback",
|
|
7
7
|
"LoopBack",
|
|
@@ -13,8 +13,8 @@
|
|
|
13
13
|
"license": "MIT",
|
|
14
14
|
"main": "dist/index.js",
|
|
15
15
|
"types": "dist/index.d.ts",
|
|
16
|
-
"author": "IBM Corp.",
|
|
17
|
-
"copyright.owner": "IBM Corp.",
|
|
16
|
+
"author": "IBM Corp. and LoopBack contributors",
|
|
17
|
+
"copyright.owner": "IBM Corp. and LoopBack contributors",
|
|
18
18
|
"repository": {
|
|
19
19
|
"type": "git",
|
|
20
20
|
"url": "https://github.com/loopbackio/loopback-next.git",
|
|
@@ -47,20 +47,20 @@
|
|
|
47
47
|
"access": "public"
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
|
-
"@loopback/authentication": "^9.0.
|
|
51
|
-
"@loopback/authentication-passport": "^5.0.
|
|
52
|
-
"@loopback/boot": "^5.0.
|
|
53
|
-
"@loopback/core": "^4.0.
|
|
54
|
-
"@loopback/mock-oauth2-provider": "^0.6.
|
|
55
|
-
"@loopback/repository": "^5.0.
|
|
56
|
-
"@loopback/rest": "^12.0.
|
|
57
|
-
"@loopback/rest-crud": "^0.
|
|
58
|
-
"@loopback/rest-explorer": "^5.0.
|
|
59
|
-
"@loopback/security": "^0.8.
|
|
60
|
-
"@loopback/service-proxy": "^5.0.
|
|
61
|
-
"@types/jsonwebtoken": "8.5.
|
|
62
|
-
"@types/lodash": "^4.14.
|
|
63
|
-
"@types/passport": "^1.0.
|
|
50
|
+
"@loopback/authentication": "^9.0.3",
|
|
51
|
+
"@loopback/authentication-passport": "^5.0.3",
|
|
52
|
+
"@loopback/boot": "^5.0.3",
|
|
53
|
+
"@loopback/core": "^4.0.3",
|
|
54
|
+
"@loopback/mock-oauth2-provider": "^0.6.3",
|
|
55
|
+
"@loopback/repository": "^5.0.3",
|
|
56
|
+
"@loopback/rest": "^12.0.3",
|
|
57
|
+
"@loopback/rest-crud": "^0.15.2",
|
|
58
|
+
"@loopback/rest-explorer": "^5.0.3",
|
|
59
|
+
"@loopback/security": "^0.8.3",
|
|
60
|
+
"@loopback/service-proxy": "^5.0.3",
|
|
61
|
+
"@types/jsonwebtoken": "8.5.9",
|
|
62
|
+
"@types/lodash": "^4.14.184",
|
|
63
|
+
"@types/passport": "^1.0.10",
|
|
64
64
|
"@types/passport-facebook": "^2.1.11",
|
|
65
65
|
"@types/passport-google-oauth": "^1.0.42",
|
|
66
66
|
"@types/passport-google-oauth2": "^0.1.5",
|
|
@@ -72,10 +72,10 @@
|
|
|
72
72
|
"client-sessions": "^0.8.0",
|
|
73
73
|
"debug": "^4.3.4",
|
|
74
74
|
"express": "^4.18.1",
|
|
75
|
-
"express-session": "^1.17.
|
|
75
|
+
"express-session": "^1.17.3",
|
|
76
76
|
"jade": "^1.11.0",
|
|
77
77
|
"lodash": "^4.17.21",
|
|
78
|
-
"passport": "^0.5.
|
|
78
|
+
"passport": "^0.5.3",
|
|
79
79
|
"passport-facebook": "^3.0.0",
|
|
80
80
|
"passport-google": "^0.3.0",
|
|
81
81
|
"passport-google-oauth2": "^0.2.0",
|
|
@@ -87,17 +87,17 @@
|
|
|
87
87
|
"tslib": "^2.4.0"
|
|
88
88
|
},
|
|
89
89
|
"devDependencies": {
|
|
90
|
-
"@loopback/build": "^9.0.
|
|
91
|
-
"@loopback/eslint-config": "^13.0.
|
|
92
|
-
"@loopback/http-caching-proxy": "^4.0.
|
|
93
|
-
"@loopback/testlab": "^5.0.
|
|
90
|
+
"@loopback/build": "^9.0.3",
|
|
91
|
+
"@loopback/eslint-config": "^13.0.3",
|
|
92
|
+
"@loopback/http-caching-proxy": "^4.0.3",
|
|
93
|
+
"@loopback/testlab": "^5.0.3",
|
|
94
94
|
"@types/express": "^4.17.13",
|
|
95
|
-
"@types/lodash": "^4.14.
|
|
96
|
-
"@types/node": "^
|
|
95
|
+
"@types/lodash": "^4.14.184",
|
|
96
|
+
"@types/node": "^14.18.26",
|
|
97
97
|
"axios": "^0.27.2",
|
|
98
|
-
"eslint": "^8.
|
|
98
|
+
"eslint": "^8.22.0",
|
|
99
99
|
"lodash": "^4.17.21",
|
|
100
|
-
"typescript": "~4.
|
|
100
|
+
"typescript": "~4.7.4"
|
|
101
101
|
},
|
|
102
|
-
"gitHead": "
|
|
102
|
+
"gitHead": "296d9a9577fd058d1a2b2386087686cefa65a7a9"
|
|
103
103
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright IBM Corp. 2020. All Rights Reserved.
|
|
1
|
+
// Copyright IBM Corp. and LoopBack contributors 2020. All Rights Reserved.
|
|
2
2
|
// Node module: @loopback/example-passport-login
|
|
3
3
|
// This file is licensed under the MIT License.
|
|
4
4
|
// License text available at https://opensource.org/licenses/MIT
|
package/src/application.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright IBM Corp. 2020. All Rights Reserved.
|
|
1
|
+
// Copyright IBM Corp. and LoopBack contributors 2020. All Rights Reserved.
|
|
2
2
|
// Node module: @loopback/example-passport-login
|
|
3
3
|
// This file is licensed under the MIT License.
|
|
4
4
|
// License text available at https://opensource.org/licenses/MIT
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
// Copyright IBM Corp. 2020. All Rights Reserved.
|
|
1
|
+
// Copyright IBM Corp. and LoopBack contributors 2020. All Rights Reserved.
|
|
2
2
|
// Node module: @loopback/example-passport-login
|
|
3
3
|
// This file is licensed under the MIT License.
|
|
4
4
|
// License text available at https://opensource.org/licenses/MIT
|
|
5
5
|
|
|
6
6
|
import {
|
|
7
7
|
inject,
|
|
8
|
-
Provider,
|
|
9
8
|
Interceptor,
|
|
10
9
|
InvocationContext,
|
|
11
10
|
Next,
|
|
11
|
+
Provider,
|
|
12
12
|
} from '@loopback/core';
|
|
13
13
|
import {
|
|
14
|
-
|
|
14
|
+
ExpressRequestHandler,
|
|
15
15
|
RequestContext,
|
|
16
|
+
RestBindings,
|
|
16
17
|
toInterceptor,
|
|
17
|
-
ExpressRequestHandler,
|
|
18
18
|
} from '@loopback/rest';
|
|
19
19
|
|
|
20
20
|
export class FacebookOauthInterceptor implements Provider<Interceptor> {
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
// Copyright IBM Corp. 2020. All Rights Reserved.
|
|
1
|
+
// Copyright IBM Corp. and LoopBack contributors 2020. All Rights Reserved.
|
|
2
2
|
// Node module: @loopback/example-passport-login
|
|
3
3
|
// This file is licensed under the MIT License.
|
|
4
4
|
// License text available at https://opensource.org/licenses/MIT
|
|
5
5
|
|
|
6
6
|
import {
|
|
7
7
|
inject,
|
|
8
|
-
Provider,
|
|
9
8
|
Interceptor,
|
|
10
9
|
InvocationContext,
|
|
11
10
|
Next,
|
|
11
|
+
Provider,
|
|
12
12
|
} from '@loopback/core';
|
|
13
13
|
import {
|
|
14
|
-
|
|
14
|
+
ExpressRequestHandler,
|
|
15
15
|
RequestContext,
|
|
16
|
+
RestBindings,
|
|
16
17
|
toInterceptor,
|
|
17
|
-
ExpressRequestHandler,
|
|
18
18
|
} from '@loopback/rest';
|
|
19
19
|
|
|
20
20
|
export class GoogleOauthInterceptor implements Provider<Interceptor> {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright IBM Corp. 2020. All Rights Reserved.
|
|
1
|
+
// Copyright IBM Corp. and LoopBack contributors 2020. All Rights Reserved.
|
|
2
2
|
// Node module: @loopback/example-passport-login
|
|
3
3
|
// This file is licensed under the MIT License.
|
|
4
4
|
// License text available at https://opensource.org/licenses/MIT
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
// Copyright IBM Corp. 2020. All Rights Reserved.
|
|
1
|
+
// Copyright IBM Corp. and LoopBack contributors 2020. All Rights Reserved.
|
|
2
2
|
// Node module: @loopback/example-passport-login
|
|
3
3
|
// This file is licensed under the MIT License.
|
|
4
4
|
// License text available at https://opensource.org/licenses/MIT
|
|
5
5
|
|
|
6
6
|
import {
|
|
7
7
|
inject,
|
|
8
|
-
|
|
8
|
+
Interceptor,
|
|
9
9
|
InvocationContext,
|
|
10
10
|
Next,
|
|
11
|
-
|
|
11
|
+
Provider,
|
|
12
12
|
} from '@loopback/core';
|
|
13
13
|
import {
|
|
14
|
-
|
|
14
|
+
ExpressRequestHandler,
|
|
15
15
|
RequestContext,
|
|
16
|
+
RestBindings,
|
|
16
17
|
toInterceptor,
|
|
17
|
-
ExpressRequestHandler,
|
|
18
18
|
} from '@loopback/rest';
|
|
19
19
|
|
|
20
20
|
export class CustomOauth2Interceptor implements Provider<Interceptor> {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
// Copyright IBM Corp. 2020. All Rights Reserved.
|
|
1
|
+
// Copyright IBM Corp. and LoopBack contributors 2020. All Rights Reserved.
|
|
2
2
|
// Node module: @loopback/example-passport-login
|
|
3
3
|
// This file is licensed under the MIT License.
|
|
4
4
|
// License text available at https://opensource.org/licenses/MIT
|
|
5
5
|
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
6
|
+
import {Interceptor, InvocationContext, Next, Provider} from '@loopback/core';
|
|
7
|
+
import {RequestContext, RestBindings} from '@loopback/rest';
|
|
8
8
|
import {SecurityBindings} from '@loopback/security';
|
|
9
9
|
import {mapProfile} from '../authentication-strategies/types';
|
|
10
10
|
import {User} from '../models';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright IBM Corp. 2020. All Rights Reserved.
|
|
1
|
+
// Copyright IBM Corp. and LoopBack contributors 2020. All Rights Reserved.
|
|
2
2
|
// Node module: @loopback/example-passport-login
|
|
3
3
|
// This file is licensed under the MIT License.
|
|
4
4
|
// License text available at https://opensource.org/licenses/MIT
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright IBM Corp. 2020. All Rights Reserved.
|
|
1
|
+
// Copyright IBM Corp. and LoopBack contributors 2020. All Rights Reserved.
|
|
2
2
|
// Node module: @loopback/example-passport-login
|
|
3
3
|
// This file is licensed under the MIT License.
|
|
4
4
|
// License text available at https://opensource.org/licenses/MIT
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright IBM Corp. 2020. All Rights Reserved.
|
|
1
|
+
// Copyright IBM Corp. and LoopBack contributors 2020. All Rights Reserved.
|
|
2
2
|
// Node module: @loopback/example-passport-login
|
|
3
3
|
// This file is licensed under the MIT License.
|
|
4
4
|
// License text available at https://opensource.org/licenses/MIT
|
|
@@ -87,7 +87,7 @@ export class BasicStrategy implements AuthenticationStrategy {
|
|
|
87
87
|
include: ['profiles', 'credentials'],
|
|
88
88
|
})
|
|
89
89
|
.then((users: User[]) => {
|
|
90
|
-
if (!users
|
|
90
|
+
if (!users?.length) {
|
|
91
91
|
return done(null, false);
|
|
92
92
|
}
|
|
93
93
|
const user = users[0];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright IBM Corp. 2020. All Rights Reserved.
|
|
1
|
+
// Copyright IBM Corp. and LoopBack contributors 2020. All Rights Reserved.
|
|
2
2
|
// Node module: @loopback/example-passport-login
|
|
3
3
|
// This file is licensed under the MIT License.
|
|
4
4
|
// License text available at https://opensource.org/licenses/MIT
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright IBM Corp. 2020. All Rights Reserved.
|
|
1
|
+
// Copyright IBM Corp. and LoopBack contributors 2020. All Rights Reserved.
|
|
2
2
|
// Node module: @loopback/example-passport-login
|
|
3
3
|
// This file is licensed under the MIT License.
|
|
4
4
|
// License text available at https://opensource.org/licenses/MIT
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright IBM Corp. 2020. All Rights Reserved.
|
|
1
|
+
// Copyright IBM Corp. and LoopBack contributors 2020. All Rights Reserved.
|
|
2
2
|
// Node module: @loopback/example-passport-login
|
|
3
3
|
// This file is licensed under the MIT License.
|
|
4
4
|
// License text available at https://opensource.org/licenses/MIT
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright IBM Corp. 2020. All Rights Reserved.
|
|
1
|
+
// Copyright IBM Corp. and LoopBack contributors 2020. All Rights Reserved.
|
|
2
2
|
// Node module: @loopback/example-passport-login
|
|
3
3
|
// This file is licensed under the MIT License.
|
|
4
4
|
// License text available at https://opensource.org/licenses/MIT
|
|
@@ -83,7 +83,7 @@ export class LocalAuthStrategy implements AuthenticationStrategy {
|
|
|
83
83
|
* Passport-local strategy fails authentication with the third argument,
|
|
84
84
|
* the first argument assumes an error in the authenticating process.
|
|
85
85
|
*/
|
|
86
|
-
if (!users
|
|
86
|
+
if (!users?.length) {
|
|
87
87
|
return done(null, null, {message: AUTH_FAILED_MESSAGE});
|
|
88
88
|
}
|
|
89
89
|
const user = users[0];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright IBM Corp. 2020. All Rights Reserved.
|
|
1
|
+
// Copyright IBM Corp. and LoopBack contributors 2020. All Rights Reserved.
|
|
2
2
|
// Node module: @loopback/example-passport-login
|
|
3
3
|
// This file is licensed under the MIT License.
|
|
4
4
|
// License text available at https://opensource.org/licenses/MIT
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright IBM Corp. 2020. All Rights Reserved.
|
|
1
|
+
// Copyright IBM Corp. and LoopBack contributors 2020. All Rights Reserved.
|
|
2
2
|
// Node module: @loopback/example-passport-login
|
|
3
3
|
// This file is licensed under the MIT License.
|
|
4
4
|
// License text available at https://opensource.org/licenses/MIT
|
|
@@ -28,7 +28,7 @@ export class SessionStrategy implements AuthenticationStrategy {
|
|
|
28
28
|
async authenticate(
|
|
29
29
|
request: RequestWithSession,
|
|
30
30
|
): Promise<UserProfile | RedirectRoute | undefined> {
|
|
31
|
-
if (!request
|
|
31
|
+
if (!request?.session?.user) {
|
|
32
32
|
throw new HttpErrors.Unauthorized(`Invalid Session`);
|
|
33
33
|
}
|
|
34
34
|
const user: User = request.session.user as User;
|
|
@@ -40,7 +40,7 @@ export class SessionStrategy implements AuthenticationStrategy {
|
|
|
40
40
|
email: user.email,
|
|
41
41
|
},
|
|
42
42
|
});
|
|
43
|
-
if (!users
|
|
43
|
+
if (!users?.length) {
|
|
44
44
|
throw new HttpErrors.Unauthorized(`User not registered`);
|
|
45
45
|
}
|
|
46
46
|
return mapProfile(request.session.user as User);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright IBM Corp. 2020. All Rights Reserved.
|
|
1
|
+
// Copyright IBM Corp. and LoopBack contributors 2020. All Rights Reserved.
|
|
2
2
|
// Node module: @loopback/example-passport-login
|
|
3
3
|
// This file is licensed under the MIT License.
|
|
4
4
|
// License text available at https://opensource.org/licenses/MIT
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
// Copyright IBM Corp. 2020. All Rights Reserved.
|
|
1
|
+
// Copyright IBM Corp. and LoopBack contributors 2020. All Rights Reserved.
|
|
2
2
|
// Node module: @loopback/example-passport-login
|
|
3
3
|
// This file is licensed under the MIT License.
|
|
4
4
|
// License text available at https://opensource.org/licenses/MIT
|
|
5
5
|
|
|
6
|
+
import {UserIdentityService} from '@loopback/authentication';
|
|
7
|
+
import {securityId, UserProfile} from '@loopback/security';
|
|
6
8
|
import axios from 'axios';
|
|
7
9
|
import {Profile} from 'passport';
|
|
8
|
-
import {UserIdentityService} from '@loopback/authentication';
|
|
9
10
|
import {User} from '../models';
|
|
10
|
-
import {UserProfile, securityId} from '@loopback/security';
|
|
11
11
|
|
|
12
12
|
export type ProfileFunction = (
|
|
13
13
|
accessToken: string,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright IBM Corp. 2020. All Rights Reserved.
|
|
1
|
+
// Copyright IBM Corp. and LoopBack contributors 2020. All Rights Reserved.
|
|
2
2
|
// Node module: @loopback/example-passport-login
|
|
3
3
|
// This file is licensed under the MIT License.
|
|
4
4
|
// License text available at https://opensource.org/licenses/MIT
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright IBM Corp. 2020. All Rights Reserved.
|
|
1
|
+
// Copyright IBM Corp. and LoopBack contributors 2020. All Rights Reserved.
|
|
2
2
|
// Node module: @loopback/example-passport-login
|
|
3
3
|
// This file is licensed under the MIT License.
|
|
4
4
|
// License text available at https://opensource.org/licenses/MIT
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright IBM Corp. 2020. All Rights Reserved.
|
|
1
|
+
// Copyright IBM Corp. and LoopBack contributors 2020. All Rights Reserved.
|
|
2
2
|
// Node module: @loopback/example-passport-login
|
|
3
3
|
// This file is licensed under the MIT License.
|
|
4
4
|
// License text available at https://opensource.org/licenses/MIT
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright IBM Corp. 2020. All Rights Reserved.
|
|
1
|
+
// Copyright IBM Corp. and LoopBack contributors 2020. All Rights Reserved.
|
|
2
2
|
// Node module: @loopback/example-passport-login
|
|
3
3
|
// This file is licensed under the MIT License.
|
|
4
4
|
// License text available at https://opensource.org/licenses/MIT
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright IBM Corp. 2020. All Rights Reserved.
|
|
1
|
+
// Copyright IBM Corp. and LoopBack contributors 2020. All Rights Reserved.
|
|
2
2
|
// Node module: @loopback/example-passport-login
|
|
3
3
|
// This file is licensed under the MIT License.
|
|
4
4
|
// License text available at https://opensource.org/licenses/MIT
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright IBM Corp. 2020. All Rights Reserved.
|
|
1
|
+
// Copyright IBM Corp. and LoopBack contributors 2020. All Rights Reserved.
|
|
2
2
|
// Node module: @loopback/example-passport-login
|
|
3
3
|
// This file is licensed under the MIT License.
|
|
4
4
|
// License text available at https://opensource.org/licenses/MIT
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright IBM Corp. 2020. All Rights Reserved.
|
|
1
|
+
// Copyright IBM Corp. and LoopBack contributors 2020. All Rights Reserved.
|
|
2
2
|
// Node module: @loopback/example-passport-login
|
|
3
3
|
// This file is licensed under the MIT License.
|
|
4
4
|
// License text available at https://opensource.org/licenses/MIT
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright IBM Corp. 2020. All Rights Reserved.
|
|
1
|
+
// Copyright IBM Corp. and LoopBack contributors 2020. All Rights Reserved.
|
|
2
2
|
// Node module: @loopback/example-passport-login
|
|
3
3
|
// This file is licensed under the MIT License.
|
|
4
4
|
// License text available at https://opensource.org/licenses/MIT
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright IBM Corp. 2020. All Rights Reserved.
|
|
1
|
+
// Copyright IBM Corp. and LoopBack contributors 2020. All Rights Reserved.
|
|
2
2
|
// Node module: @loopback/example-passport-login
|
|
3
3
|
// This file is licensed under the MIT License.
|
|
4
4
|
// License text available at https://opensource.org/licenses/MIT
|
package/src/controllers/index.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
// Copyright IBM Corp. 2020. All Rights Reserved.
|
|
1
|
+
// Copyright IBM Corp. and LoopBack contributors 2020. All Rights Reserved.
|
|
2
2
|
// Node module: @loopback/example-passport-login
|
|
3
3
|
// This file is licensed under the MIT License.
|
|
4
4
|
// License text available at https://opensource.org/licenses/MIT
|
|
5
5
|
|
|
6
6
|
export * from './oauth2.controller';
|
|
7
|
-
export * from './user.controller';
|
|
8
7
|
export * from './ping.controller';
|
|
8
|
+
export * from './user.controller';
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
// Copyright IBM Corp. 2020. All Rights Reserved.
|
|
1
|
+
// Copyright IBM Corp. and LoopBack contributors 2020. All Rights Reserved.
|
|
2
2
|
// Node module: @loopback/example-passport-login
|
|
3
3
|
// This file is licensed under the MIT License.
|
|
4
4
|
// License text available at https://opensource.org/licenses/MIT
|
|
5
5
|
|
|
6
|
+
import {authenticate, AuthenticationBindings} from '@loopback/authentication';
|
|
7
|
+
import {inject} from '@loopback/core';
|
|
6
8
|
import {
|
|
7
9
|
get,
|
|
8
|
-
RestBindings,
|
|
9
|
-
Response,
|
|
10
|
-
RequestWithSession,
|
|
11
10
|
param,
|
|
11
|
+
RequestWithSession,
|
|
12
|
+
Response,
|
|
13
|
+
RestBindings,
|
|
12
14
|
} from '@loopback/rest';
|
|
13
|
-
import {authenticate, AuthenticationBindings} from '@loopback/authentication';
|
|
14
|
-
import {inject} from '@loopback/core';
|
|
15
15
|
import {SecurityBindings, UserProfile} from '@loopback/security';
|
|
16
16
|
import {oAuth2InterceptExpressMiddleware} from '../authentication-interceptors/types';
|
|
17
17
|
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
// Copyright IBM Corp. 2020. All Rights Reserved.
|
|
1
|
+
// Copyright IBM Corp. and LoopBack contributors 2020. All Rights Reserved.
|
|
2
2
|
// Node module: @loopback/example-passport-login
|
|
3
3
|
// This file is licensed under the MIT License.
|
|
4
4
|
// License text available at https://opensource.org/licenses/MIT
|
|
5
5
|
|
|
6
|
+
import {authenticate} from '@loopback/authentication';
|
|
7
|
+
import {inject} from '@loopback/core';
|
|
6
8
|
import {
|
|
7
|
-
Request,
|
|
8
|
-
RestBindings,
|
|
9
9
|
get,
|
|
10
|
+
Request,
|
|
10
11
|
RequestBodyObject,
|
|
12
|
+
RestBindings,
|
|
11
13
|
SchemaObject,
|
|
12
14
|
} from '@loopback/rest';
|
|
13
|
-
import {inject} from '@loopback/core';
|
|
14
|
-
import {authenticate} from '@loopback/authentication';
|
|
15
15
|
import {SecurityBindings, UserProfile} from '@loopback/security';
|
|
16
16
|
|
|
17
17
|
const HEADER_SCHEMA: SchemaObject = {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright IBM Corp. 2020. All Rights Reserved.
|
|
1
|
+
// Copyright IBM Corp. and LoopBack contributors 2020. All Rights Reserved.
|
|
2
2
|
// Node module: @loopback/example-passport-login
|
|
3
3
|
// This file is licensed under the MIT License.
|
|
4
4
|
// License text available at https://opensource.org/licenses/MIT
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright IBM Corp. 2020. All Rights Reserved.
|
|
1
|
+
// Copyright IBM Corp. and LoopBack contributors 2020. All Rights Reserved.
|
|
2
2
|
// Node module: @loopback/example-passport-login
|
|
3
3
|
// This file is licensed under the MIT License.
|
|
4
4
|
// License text available at https://opensource.org/licenses/MIT
|
package/src/datasources/index.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright IBM Corp. 2020. All Rights Reserved.
|
|
1
|
+
// Copyright IBM Corp. and LoopBack contributors 2020. All Rights Reserved.
|
|
2
2
|
// Node module: @loopback/example-passport-login
|
|
3
3
|
// This file is licensed under the MIT License.
|
|
4
4
|
// License text available at https://opensource.org/licenses/MIT
|
package/src/index.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright IBM Corp. 2020. All Rights Reserved.
|
|
1
|
+
// Copyright IBM Corp. and LoopBack contributors 2020. All Rights Reserved.
|
|
2
2
|
// Node module: @loopback/example-passport-login
|
|
3
3
|
// This file is licensed under the MIT License.
|
|
4
4
|
// License text available at https://opensource.org/licenses/MIT
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright IBM Corp. 2020. All Rights Reserved.
|
|
1
|
+
// Copyright IBM Corp. and LoopBack contributors 2020. All Rights Reserved.
|
|
2
2
|
// Node module: @loopback/example-passport-login
|
|
3
3
|
// This file is licensed under the MIT License.
|
|
4
4
|
// License text available at https://opensource.org/licenses/MIT
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright IBM Corp. 2020. All Rights Reserved.
|
|
1
|
+
// Copyright IBM Corp. and LoopBack contributors 2020. All Rights Reserved.
|
|
2
2
|
// Node module: @loopback/example-passport-login
|
|
3
3
|
// This file is licensed under the MIT License.
|
|
4
4
|
// License text available at https://opensource.org/licenses/MIT
|
package/src/models/index.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
// Copyright IBM Corp. 2020. All Rights Reserved.
|
|
1
|
+
// Copyright IBM Corp. and LoopBack contributors 2020. All Rights Reserved.
|
|
2
2
|
// Node module: @loopback/example-passport-login
|
|
3
3
|
// This file is licensed under the MIT License.
|
|
4
4
|
// License text available at https://opensource.org/licenses/MIT
|
|
5
5
|
|
|
6
|
-
export * from './user.model';
|
|
7
6
|
export * from './user-credentials.model';
|
|
8
7
|
export * from './user-identity.model';
|
|
8
|
+
export * from './user.model';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright IBM Corp. 2020. All Rights Reserved.
|
|
1
|
+
// Copyright IBM Corp. and LoopBack contributors 2020. All Rights Reserved.
|
|
2
2
|
// Node module: @loopback/example-passport-login
|
|
3
3
|
// This file is licensed under the MIT License.
|
|
4
4
|
// License text available at https://opensource.org/licenses/MIT
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
// Copyright IBM Corp. 2020. All Rights Reserved.
|
|
1
|
+
// Copyright IBM Corp. and LoopBack contributors 2020. All Rights Reserved.
|
|
2
2
|
// Node module: @loopback/example-passport-login
|
|
3
3
|
// This file is licensed under the MIT License.
|
|
4
4
|
// License text available at https://opensource.org/licenses/MIT
|
|
5
5
|
|
|
6
|
-
import {Entity, model, property
|
|
6
|
+
import {belongsTo, Entity, model, property} from '@loopback/repository';
|
|
7
7
|
import {User} from './user.model';
|
|
8
8
|
|
|
9
9
|
@model()
|
package/src/models/user.model.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
// Copyright IBM Corp. 2020. All Rights Reserved.
|
|
1
|
+
// Copyright IBM Corp. and LoopBack contributors 2020. All Rights Reserved.
|
|
2
2
|
// Node module: @loopback/example-passport-login
|
|
3
3
|
// This file is licensed under the MIT License.
|
|
4
4
|
// License text available at https://opensource.org/licenses/MIT
|
|
5
5
|
|
|
6
|
-
import {Entity,
|
|
6
|
+
import {Entity, hasMany, hasOne, model, property} from '@loopback/repository';
|
|
7
7
|
import {UserCredentials} from './user-credentials.model';
|
|
8
8
|
import {UserIdentity} from './user-identity.model';
|
|
9
9
|
|