@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.
Files changed (174) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/LICENSE +2 -2
  3. package/dist/__tests__/acceptance/passport-login.acceptance.js +1 -1
  4. package/dist/__tests__/acceptance/passport-login.acceptance.js.map +1 -1
  5. package/dist/application.d.ts +3 -3
  6. package/dist/application.js +1 -1
  7. package/dist/application.js.map +1 -1
  8. package/dist/authentication-interceptors/facebook.interceptor.d.ts +1 -1
  9. package/dist/authentication-interceptors/facebook.interceptor.js +1 -1
  10. package/dist/authentication-interceptors/facebook.interceptor.js.map +1 -1
  11. package/dist/authentication-interceptors/google.interceptor.d.ts +1 -1
  12. package/dist/authentication-interceptors/google.interceptor.js +1 -1
  13. package/dist/authentication-interceptors/google.interceptor.js.map +1 -1
  14. package/dist/authentication-interceptors/index.js +1 -1
  15. package/dist/authentication-interceptors/index.js.map +1 -1
  16. package/dist/authentication-interceptors/oauth2.interceptor.d.ts +1 -1
  17. package/dist/authentication-interceptors/oauth2.interceptor.js +1 -1
  18. package/dist/authentication-interceptors/oauth2.interceptor.js.map +1 -1
  19. package/dist/authentication-interceptors/session.interceptor.d.ts +1 -1
  20. package/dist/authentication-interceptors/session.interceptor.js +1 -1
  21. package/dist/authentication-interceptors/session.interceptor.js.map +1 -1
  22. package/dist/authentication-interceptors/twitter.interceptor.js +1 -1
  23. package/dist/authentication-interceptors/twitter.interceptor.js.map +1 -1
  24. package/dist/authentication-interceptors/types.js +1 -1
  25. package/dist/authentication-interceptors/types.js.map +1 -1
  26. package/dist/authentication-strategies/basic.js +2 -2
  27. package/dist/authentication-strategies/basic.js.map +1 -1
  28. package/dist/authentication-strategies/facebook.js +1 -1
  29. package/dist/authentication-strategies/facebook.js.map +1 -1
  30. package/dist/authentication-strategies/google.js +1 -1
  31. package/dist/authentication-strategies/google.js.map +1 -1
  32. package/dist/authentication-strategies/index.js +1 -1
  33. package/dist/authentication-strategies/index.js.map +1 -1
  34. package/dist/authentication-strategies/local.js +2 -2
  35. package/dist/authentication-strategies/local.js.map +1 -1
  36. package/dist/authentication-strategies/oauth2.js +1 -1
  37. package/dist/authentication-strategies/oauth2.js.map +1 -1
  38. package/dist/authentication-strategies/session.js +4 -3
  39. package/dist/authentication-strategies/session.js.map +1 -1
  40. package/dist/authentication-strategies/twitter.js +1 -1
  41. package/dist/authentication-strategies/twitter.js.map +1 -1
  42. package/dist/authentication-strategies/types.d.ts +2 -2
  43. package/dist/authentication-strategies/types.js +2 -2
  44. package/dist/authentication-strategies/types.js.map +1 -1
  45. package/dist/authentication-strategy-providers/facebook.express-mw.js +1 -1
  46. package/dist/authentication-strategy-providers/facebook.express-mw.js.map +1 -1
  47. package/dist/authentication-strategy-providers/facebook.js +1 -1
  48. package/dist/authentication-strategy-providers/facebook.js.map +1 -1
  49. package/dist/authentication-strategy-providers/google.express-mw.js +1 -1
  50. package/dist/authentication-strategy-providers/google.express-mw.js.map +1 -1
  51. package/dist/authentication-strategy-providers/google.js +1 -1
  52. package/dist/authentication-strategy-providers/google.js.map +1 -1
  53. package/dist/authentication-strategy-providers/index.js +1 -1
  54. package/dist/authentication-strategy-providers/index.js.map +1 -1
  55. package/dist/authentication-strategy-providers/oauth2.express-mw.js +1 -1
  56. package/dist/authentication-strategy-providers/oauth2.express-mw.js.map +1 -1
  57. package/dist/authentication-strategy-providers/oauth2.js +1 -1
  58. package/dist/authentication-strategy-providers/oauth2.js.map +1 -1
  59. package/dist/authentication-strategy-providers/twitter.express-mw.js +1 -1
  60. package/dist/authentication-strategy-providers/twitter.express-mw.js.map +1 -1
  61. package/dist/authentication-strategy-providers/twitter.js +1 -1
  62. package/dist/authentication-strategy-providers/twitter.js.map +1 -1
  63. package/dist/controllers/index.d.ts +1 -1
  64. package/dist/controllers/index.js +2 -2
  65. package/dist/controllers/index.js.map +1 -1
  66. package/dist/controllers/oauth2.controller.d.ts +1 -1
  67. package/dist/controllers/oauth2.controller.js +2 -2
  68. package/dist/controllers/oauth2.controller.js.map +1 -1
  69. package/dist/controllers/ping.controller.js +3 -3
  70. package/dist/controllers/ping.controller.js.map +1 -1
  71. package/dist/controllers/user.controller.js +1 -1
  72. package/dist/controllers/user.controller.js.map +1 -1
  73. package/dist/datasources/db.datasource.js +1 -1
  74. package/dist/datasources/db.datasource.js.map +1 -1
  75. package/dist/datasources/index.js +1 -1
  76. package/dist/datasources/index.js.map +1 -1
  77. package/dist/index.js +1 -1
  78. package/dist/index.js.map +1 -1
  79. package/dist/model-endpoints/index.js +1 -1
  80. package/dist/model-endpoints/index.js.map +1 -1
  81. package/dist/model-endpoints/user.rest-config.js +1 -1
  82. package/dist/model-endpoints/user.rest-config.js.map +1 -1
  83. package/dist/models/index.d.ts +1 -1
  84. package/dist/models/index.js +2 -2
  85. package/dist/models/index.js.map +1 -1
  86. package/dist/models/user-credentials.model.js +1 -1
  87. package/dist/models/user-credentials.model.js.map +1 -1
  88. package/dist/models/user-identity.model.js +1 -1
  89. package/dist/models/user-identity.model.js.map +1 -1
  90. package/dist/models/user.model.js +1 -1
  91. package/dist/models/user.model.js.map +1 -1
  92. package/dist/observers/index.js +1 -1
  93. package/dist/observers/index.js.map +1 -1
  94. package/dist/observers/wire.observer.js +1 -1
  95. package/dist/observers/wire.observer.js.map +1 -1
  96. package/dist/repositories/index.js +1 -1
  97. package/dist/repositories/index.js.map +1 -1
  98. package/dist/repositories/user-credentials.repository.d.ts +1 -1
  99. package/dist/repositories/user-credentials.repository.js +3 -3
  100. package/dist/repositories/user-credentials.repository.js.map +1 -1
  101. package/dist/repositories/user-identity.repository.d.ts +1 -1
  102. package/dist/repositories/user-identity.repository.js +3 -3
  103. package/dist/repositories/user-identity.repository.js.map +1 -1
  104. package/dist/repositories/user.repository.d.ts +2 -2
  105. package/dist/repositories/user.repository.js +1 -1
  106. package/dist/repositories/user.repository.js.map +1 -1
  107. package/dist/sequence.js +1 -1
  108. package/dist/sequence.js.map +1 -1
  109. package/dist/server.js +1 -1
  110. package/dist/server.js.map +1 -1
  111. package/dist/services/index.d.ts +1 -1
  112. package/dist/services/index.js +2 -2
  113. package/dist/services/index.js.map +1 -1
  114. package/dist/services/keys.d.ts +1 -1
  115. package/dist/services/keys.js +1 -1
  116. package/dist/services/keys.js.map +1 -1
  117. package/dist/services/user.service.js +5 -5
  118. package/dist/services/user.service.js.map +1 -1
  119. package/dist/wiring.js +1 -1
  120. package/dist/wiring.js.map +1 -1
  121. package/package.json +28 -28
  122. package/src/__tests__/acceptance/passport-login.acceptance.ts +1 -1
  123. package/src/application.ts +1 -1
  124. package/src/authentication-interceptors/facebook.interceptor.ts +4 -4
  125. package/src/authentication-interceptors/google.interceptor.ts +4 -4
  126. package/src/authentication-interceptors/index.ts +1 -1
  127. package/src/authentication-interceptors/oauth2.interceptor.ts +5 -5
  128. package/src/authentication-interceptors/session.interceptor.ts +3 -3
  129. package/src/authentication-interceptors/twitter.interceptor.ts +1 -1
  130. package/src/authentication-interceptors/types.ts +1 -1
  131. package/src/authentication-strategies/basic.ts +2 -2
  132. package/src/authentication-strategies/facebook.ts +1 -1
  133. package/src/authentication-strategies/google.ts +1 -1
  134. package/src/authentication-strategies/index.ts +1 -1
  135. package/src/authentication-strategies/local.ts +2 -2
  136. package/src/authentication-strategies/oauth2.ts +1 -1
  137. package/src/authentication-strategies/session.ts +3 -3
  138. package/src/authentication-strategies/twitter.ts +1 -1
  139. package/src/authentication-strategies/types.ts +3 -3
  140. package/src/authentication-strategy-providers/facebook.express-mw.ts +1 -1
  141. package/src/authentication-strategy-providers/facebook.ts +1 -1
  142. package/src/authentication-strategy-providers/google.express-mw.ts +1 -1
  143. package/src/authentication-strategy-providers/google.ts +1 -1
  144. package/src/authentication-strategy-providers/index.ts +1 -1
  145. package/src/authentication-strategy-providers/oauth2.express-mw.ts +1 -1
  146. package/src/authentication-strategy-providers/oauth2.ts +1 -1
  147. package/src/authentication-strategy-providers/twitter.express-mw.ts +1 -1
  148. package/src/authentication-strategy-providers/twitter.ts +1 -1
  149. package/src/controllers/index.ts +2 -2
  150. package/src/controllers/oauth2.controller.ts +6 -6
  151. package/src/controllers/ping.controller.ts +5 -5
  152. package/src/controllers/user.controller.ts +1 -1
  153. package/src/datasources/db.datasource.ts +1 -1
  154. package/src/datasources/index.ts +1 -1
  155. package/src/index.ts +1 -1
  156. package/src/model-endpoints/index.ts +1 -1
  157. package/src/model-endpoints/user.rest-config.ts +1 -1
  158. package/src/models/index.ts +2 -2
  159. package/src/models/user-credentials.model.ts +1 -1
  160. package/src/models/user-identity.model.ts +2 -2
  161. package/src/models/user.model.ts +2 -2
  162. package/src/observers/index.ts +1 -1
  163. package/src/observers/wire.observer.ts +1 -1
  164. package/src/repositories/index.ts +1 -1
  165. package/src/repositories/user-credentials.repository.ts +3 -3
  166. package/src/repositories/user-identity.repository.ts +3 -3
  167. package/src/repositories/user.repository.ts +5 -5
  168. package/src/sequence.ts +1 -1
  169. package/src/server.ts +1 -1
  170. package/src/services/index.ts +2 -2
  171. package/src/services/keys.ts +2 -2
  172. package/src/services/user.service.ts +3 -3
  173. package/src/wiring.ts +1 -1
  174. 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.emails || !profile.emails.length) {
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 || !users.length) {
40
- const name = ((_a = profile.name) === null || _a === void 0 ? void 0 : _a.givenName)
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,iDAAiD;AACjD,gDAAgD;AAChD,+CAA+C;AAC/C,gEAAgE;;;;AAGhE,qDAAgD;AAGhD,kDAA+C;AAC/C,uFAAgF;AAEhF;;GAEG;AACH,IAAa,2BAA2B,GAAxC,MAAa,2BAA2B;IAGtC,YAES,cAA8B,EAE9B,sBAA8C;QAF9C,mBAAc,GAAd,cAAc,CAAgB;QAE9B,2BAAsB,GAAtB,sBAAsB,CAAwB;IACpD,CAAC;IAEJ;;;;;;OAMG;IACH,KAAK,CAAC,gBAAgB,CAAC,OAAwB;;QAC7C,IAAI,CAAC,OAAO,CAAC,MAAM,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE;YAC7C,MAAM,IAAI,KAAK,CAAC,mDAAmD,CAAC,CAAC;SACtE;QAED,MAAM,KAAK,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;QAEtC,MAAM,KAAK,GAAW,MAAM,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC;YACnD,KAAK,EAAE;gBACL,KAAK,EAAE,KAAK;aACb;SACF,CAAC,CAAC;QACH,IAAI,IAAU,CAAC;QACf,IAAI,CAAC,KAAK,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE;YAC3B,MAAM,IAAI,GAAG,CAAA,MAAA,OAAO,CAAC,IAAI,0CAAE,SAAS;gBAClC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N,iDAAsB;GAP5C,2BAA2B,CAqGvC;AArGY,kEAA2B"}
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
@@ -1 +1 @@
1
- {"version":3,"file":"wiring.js","sourceRoot":"","sources":["../src/wiring.ts"],"names":[],"mappings":";AAAA,iDAAiD;AACjD,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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  "name": "@loopback/example-passport-login",
3
3
  "description": "An example to demonstrate authentication with passport strategies",
4
- "version": "4.0.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.0",
51
- "@loopback/authentication-passport": "^5.0.0",
52
- "@loopback/boot": "^5.0.0",
53
- "@loopback/core": "^4.0.0",
54
- "@loopback/mock-oauth2-provider": "^0.6.0",
55
- "@loopback/repository": "^5.0.0",
56
- "@loopback/rest": "^12.0.0",
57
- "@loopback/rest-crud": "^0.14.0",
58
- "@loopback/rest-explorer": "^5.0.0",
59
- "@loopback/security": "^0.8.0",
60
- "@loopback/service-proxy": "^5.0.0",
61
- "@types/jsonwebtoken": "8.5.8",
62
- "@types/lodash": "^4.14.182",
63
- "@types/passport": "^1.0.7",
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.2",
75
+ "express-session": "^1.17.3",
76
76
  "jade": "^1.11.0",
77
77
  "lodash": "^4.17.21",
78
- "passport": "^0.5.2",
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.0",
91
- "@loopback/eslint-config": "^13.0.0",
92
- "@loopback/http-caching-proxy": "^4.0.0",
93
- "@loopback/testlab": "^5.0.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.182",
96
- "@types/node": "^12.20.50",
95
+ "@types/lodash": "^4.14.184",
96
+ "@types/node": "^14.18.26",
97
97
  "axios": "^0.27.2",
98
- "eslint": "^8.14.0",
98
+ "eslint": "^8.22.0",
99
99
  "lodash": "^4.17.21",
100
- "typescript": "~4.6.4"
100
+ "typescript": "~4.7.4"
101
101
  },
102
- "gitHead": "61453a3d7a16f9f37875a3f2c2a071568eb3e3af"
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
@@ -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
- RestBindings,
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
- RestBindings,
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
- Provider,
8
+ Interceptor,
9
9
  InvocationContext,
10
10
  Next,
11
- Interceptor,
11
+ Provider,
12
12
  } from '@loopback/core';
13
13
  import {
14
- RestBindings,
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 {Provider, Interceptor, InvocationContext, Next} from '@loopback/core';
7
- import {RestBindings, RequestContext} from '@loopback/rest';
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 || !users.length) {
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 || !users.length) {
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.session || !request.session.user) {
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 || !users.length) {
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
@@ -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
@@ -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
@@ -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, belongsTo} from '@loopback/repository';
6
+ import {belongsTo, Entity, model, property} from '@loopback/repository';
7
7
  import {User} from './user.model';
8
8
 
9
9
  @model()
@@ -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, hasOne, hasMany} from '@loopback/repository';
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