@flink-app/generic-auth-plugin 0.12.1-alpha.9 → 0.13.0

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 (83) hide show
  1. package/.flink/generatedHandlers.ts +1 -1
  2. package/.flink/generatedJobs.ts +1 -1
  3. package/.flink/generatedRepos.ts +1 -1
  4. package/.flink/schemas/schemas.json +1 -643
  5. package/.flink/schemas/schemas.ts +1 -105
  6. package/.flink/start.ts +2 -1
  7. package/CHANGELOG.md +15 -0
  8. package/dist/.flink/generatedHandlers.js +1 -1
  9. package/dist/.flink/generatedJobs.js +1 -1
  10. package/dist/.flink/generatedRepos.js +1 -1
  11. package/dist/.flink/schemas/schemas.d.ts +0 -104
  12. package/dist/.flink/schemas/schemas.js +1 -1
  13. package/dist/.flink/schemas/schemas.json +1 -643
  14. package/dist/.flink/start.d.ts +2 -0
  15. package/dist/.flink/start.js +2 -1
  16. package/dist/src/coreFunctions.d.ts +5 -5
  17. package/dist/src/coreFunctions.js +31 -14
  18. package/dist/src/genericAuthContext.d.ts +8 -5
  19. package/dist/src/genericAuthPluginOptions.d.ts +6 -1
  20. package/dist/src/handlers/Management/DeleteUserByUserid.d.ts +0 -1
  21. package/dist/src/handlers/Management/DeleteUserByUserid.js +3 -4
  22. package/dist/src/handlers/Management/GetSchema.d.ts +0 -1
  23. package/dist/src/handlers/Management/GetSchema.js +3 -4
  24. package/dist/src/handlers/Management/GetUser.d.ts +0 -1
  25. package/dist/src/handlers/Management/GetUser.js +3 -4
  26. package/dist/src/handlers/Management/GetUserByUserid.d.ts +0 -1
  27. package/dist/src/handlers/Management/GetUserByUserid.js +3 -4
  28. package/dist/src/handlers/Management/GetUserViewByUserid.d.ts +0 -1
  29. package/dist/src/handlers/Management/GetUserViewByUserid.js +3 -4
  30. package/dist/src/handlers/Management/PutUserPasswordByUserid.d.ts +0 -1
  31. package/dist/src/handlers/Management/PutUserPasswordByUserid.js +3 -4
  32. package/dist/src/handlers/Management/PutUserProfileByUserid.d.ts +0 -1
  33. package/dist/src/handlers/Management/PutUserProfileByUserid.js +16 -9
  34. package/dist/src/handlers/Management/PutUserProfileByUseridAppend.d.ts +0 -1
  35. package/dist/src/handlers/Management/PutUserProfileByUseridAppend.js +3 -4
  36. package/dist/src/handlers/Management/PutUserRolesByUserid.d.ts +0 -1
  37. package/dist/src/handlers/Management/PutUserRolesByUserid.js +3 -4
  38. package/dist/src/handlers/Management/PutUserUsernameByUserid.d.ts +0 -1
  39. package/dist/src/handlers/Management/PutUserUsernameByUserid.js +3 -4
  40. package/dist/src/handlers/UserCreate.d.ts +0 -1
  41. package/dist/src/handlers/UserCreate.js +6 -7
  42. package/dist/src/handlers/UserLogin.d.ts +0 -1
  43. package/dist/src/handlers/UserLogin.js +42 -11
  44. package/dist/src/handlers/UserLoginByToken.d.ts +0 -1
  45. package/dist/src/handlers/UserLoginByToken.js +3 -4
  46. package/dist/src/handlers/UserPasswordPut.d.ts +0 -1
  47. package/dist/src/handlers/UserPasswordPut.js +3 -4
  48. package/dist/src/handlers/UserPasswordResetComplete.d.ts +0 -1
  49. package/dist/src/handlers/UserPasswordResetComplete.js +3 -4
  50. package/dist/src/handlers/UserPasswordResetForm.js +6 -6
  51. package/dist/src/handlers/UserPasswordResetStart.d.ts +0 -1
  52. package/dist/src/handlers/UserPasswordResetStart.js +3 -4
  53. package/dist/src/handlers/UserProfileGet.d.ts +0 -1
  54. package/dist/src/handlers/UserProfileGet.js +3 -4
  55. package/dist/src/handlers/UserProfilePut.d.ts +0 -1
  56. package/dist/src/handlers/UserProfilePut.js +11 -7
  57. package/dist/src/handlers/UserPushRegisterToken.d.ts +0 -1
  58. package/dist/src/handlers/UserPushRegisterToken.js +4 -5
  59. package/dist/src/handlers/UserPushRemoveToken.d.ts +0 -1
  60. package/dist/src/handlers/UserPushRemoveToken.js +3 -4
  61. package/dist/src/handlers/UserToken.d.ts +0 -1
  62. package/dist/src/handlers/UserToken.js +3 -4
  63. package/dist/src/index.js +2 -2
  64. package/dist/src/init.js +2 -3
  65. package/dist/src/schemas/User.d.ts +2 -1
  66. package/dist/src/schemas/UserCreateReq.d.ts +2 -1
  67. package/dist/src/schemas/UserPasswordResetCompleteRes.d.ts +4 -0
  68. package/package.json +32 -33
  69. package/readme.md +584 -570
  70. package/src/coreFunctions.ts +29 -7
  71. package/src/genericAuthContext.ts +8 -5
  72. package/src/genericAuthPluginOptions.ts +6 -1
  73. package/src/handlers/Management/PutUserProfileByUserid.ts +6 -0
  74. package/src/handlers/UserCreate.ts +3 -2
  75. package/src/handlers/UserLogin.ts +56 -31
  76. package/src/handlers/UserProfilePut.ts +20 -22
  77. package/src/handlers/UserPushRegisterToken.ts +1 -1
  78. package/src/index.ts +2 -1
  79. package/src/init.ts +108 -120
  80. package/src/schemas/User.ts +2 -1
  81. package/src/schemas/UserCreateReq.ts +5 -4
  82. package/src/schemas/UserPasswordResetCompleteRes.ts +8 -3
  83. package/tsconfig.json +21 -21
@@ -9,8 +9,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  });
10
10
  };
11
11
  var __generator = (this && this.__generator) || function (thisArg, body) {
12
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
13
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
12
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
13
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
14
  function verb(n) { return function (v) { return step([n, v]); }; }
15
15
  function step(op) {
16
16
  if (f) throw new TypeError("Generator is already executing.");
@@ -36,32 +36,63 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
36
36
  }
37
37
  };
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.__schemas = exports.__params = exports.__query = exports.__file = exports.__assumedHttpMethod = void 0;
39
+ exports.__params = exports.__query = exports.__file = exports.__assumedHttpMethod = void 0;
40
40
  var flink_1 = require("@flink-app/flink");
41
41
  var userLoginHandler = function (_a) { return __awaiter(void 0, [_a], void 0, function (_b) {
42
- var pluginName, repo, loginRespons;
42
+ var pluginName, repo, loginResponse, error_1;
43
43
  var ctx = _b.ctx, req = _b.req, origin = _b.origin;
44
44
  return __generator(this, function (_c) {
45
45
  switch (_c.label) {
46
46
  case 0:
47
47
  pluginName = origin || "genericAuthPlugin";
48
48
  repo = ctx.repos[ctx.plugins[pluginName].repoName];
49
- return [4 /*yield*/, ctx.plugins.genericAuthPlugin.loginUser(repo, ctx.auth, req.body.username, req.body.password, ctx.plugins.genericAuthPlugin.validatePasswordMethod, ctx.plugins[pluginName].smsOptions, ctx.plugins[pluginName].onSuccessfulLogin)];
49
+ loginResponse = undefined;
50
+ _c.label = 1;
50
51
  case 1:
51
- loginRespons = _c.sent();
52
- if (loginRespons.status != "success") {
53
- switch (loginRespons.status) {
52
+ _c.trys.push([1, 3, , 4]);
53
+ return [4 /*yield*/, ctx.plugins.genericAuthPlugin.loginUser(repo, ctx.auth, req.body.username, req.body.password, ctx.plugins.genericAuthPlugin.validatePasswordMethod, ctx.plugins[pluginName].smsOptions, ctx.plugins[pluginName].onSuccessfulLogin, req)];
54
+ case 2:
55
+ loginResponse = _c.sent();
56
+ return [3 /*break*/, 4];
57
+ case 3:
58
+ error_1 = _c.sent();
59
+ // Convert any thrown error that conforms to flink error structure to a proper response
60
+ // Note that any auth failures would not have been thrown, but returned as part of loginResponse
61
+ // but with this it is possible to throw errors from callbacks like onSuccessfulLogin
62
+ if (isFlinkError(error_1)) {
63
+ flink_1.log.debug("Caught FlinkError in userLoginHandler:", error_1);
64
+ return [2 /*return*/, {
65
+ status: error_1.status,
66
+ error: {
67
+ id: error_1.error.id,
68
+ title: error_1.error.title,
69
+ code: error_1.error.code,
70
+ detail: error_1.error.detail,
71
+ },
72
+ }];
73
+ }
74
+ // For other errors, return a generic 500 response
75
+ flink_1.log.error("Error in userLoginHandler:", error_1);
76
+ return [2 /*return*/, (0, flink_1.internalServerError)()];
77
+ case 4:
78
+ if ((loginResponse === null || loginResponse === void 0 ? void 0 : loginResponse.status) != "success") {
79
+ switch (loginResponse === null || loginResponse === void 0 ? void 0 : loginResponse.status) {
54
80
  case "failed":
55
- return [2 /*return*/, (0, flink_1.unauthorized)("Invalid username or password", loginRespons.status)];
81
+ return [2 /*return*/, (0, flink_1.unauthorized)("Invalid username or password", loginResponse.status)];
56
82
  }
57
83
  }
58
84
  return [2 /*return*/, {
59
- data: loginRespons,
85
+ data: loginResponse,
60
86
  status: 200,
61
87
  }];
62
88
  }
63
89
  });
64
90
  }); };
65
91
  exports.default = userLoginHandler;
92
+ function isFlinkError(res) {
93
+ if (res && res.status && typeof res.status === "number" && res.error && res.error.id) {
94
+ return true;
95
+ }
96
+ return false;
97
+ }
66
98
  exports.__assumedHttpMethod = "", exports.__file = "UserLogin.ts", exports.__query = [], exports.__params = [];
67
- exports.__schemas = { reqSchema: { "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "additionalProperties": false, "properties": { "username": { "type": "string" }, "password": { "type": "string" } }, "required": ["username"], "definitions": {} }, resSchema: { "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "additionalProperties": false, "properties": { "status": { "type": "string", "enum": ["success", "failed", "requiresValidation"] }, "user": { "type": "object", "properties": { "_id": { "type": "string" }, "username": { "type": "string" }, "token": { "type": "string" }, "profile": { "type": "object" } }, "required": ["_id", "username", "token", "profile"], "additionalProperties": false }, "validationToken": { "type": "string" } }, "required": ["status"], "definitions": {} } };
@@ -5,4 +5,3 @@ import { UserLoginRes } from "../schemas/UserLoginRes";
5
5
  declare const userLoginHandler: Handler<FlinkContext<genericAuthContext>, UserLoginByTokenReq, UserLoginRes>;
6
6
  export default userLoginHandler;
7
7
  export declare const __assumedHttpMethod = "", __file = "UserLoginByToken.ts", __query: never[], __params: never[];
8
- export declare const __schemas: any;
@@ -9,8 +9,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  });
10
10
  };
11
11
  var __generator = (this && this.__generator) || function (thisArg, body) {
12
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
13
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
12
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
13
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
14
  function verb(n) { return function (v) { return step([n, v]); }; }
15
15
  function step(op) {
16
16
  if (f) throw new TypeError("Generator is already executing.");
@@ -36,7 +36,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
36
36
  }
37
37
  };
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.__schemas = exports.__params = exports.__query = exports.__file = exports.__assumedHttpMethod = void 0;
39
+ exports.__params = exports.__query = exports.__file = exports.__assumedHttpMethod = void 0;
40
40
  var flink_1 = require("@flink-app/flink");
41
41
  var userLoginHandler = function (_a) { return __awaiter(void 0, [_a], void 0, function (_b) {
42
42
  var pluginName, repo, loginRespons;
@@ -64,4 +64,3 @@ var userLoginHandler = function (_a) { return __awaiter(void 0, [_a], void 0, fu
64
64
  }); };
65
65
  exports.default = userLoginHandler;
66
66
  exports.__assumedHttpMethod = "", exports.__file = "UserLoginByToken.ts", exports.__query = [], exports.__params = [];
67
- exports.__schemas = { reqSchema: { "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "additionalProperties": false, "properties": { "token": { "type": "string" }, "code": { "type": "string" } }, "required": ["code", "token"], "definitions": {} }, resSchema: { "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "additionalProperties": false, "properties": { "status": { "type": "string", "enum": ["success", "failed", "requiresValidation"] }, "user": { "type": "object", "properties": { "_id": { "type": "string" }, "username": { "type": "string" }, "token": { "type": "string" }, "profile": { "type": "object" } }, "required": ["_id", "username", "token", "profile"], "additionalProperties": false }, "validationToken": { "type": "string" } }, "required": ["status"], "definitions": {} } };
@@ -5,4 +5,3 @@ import { UserPasswordChangeRes } from "../schemas/UserPasswordChangeRes";
5
5
  declare const putUserPasswordHandler: Handler<FlinkContext<genericAuthContext>, UserPasswordChangeReq, UserPasswordChangeRes>;
6
6
  export default putUserPasswordHandler;
7
7
  export declare const __assumedHttpMethod = "", __file = "UserPasswordPut.ts", __query: never[], __params: never[];
8
- export declare const __schemas: any;
@@ -9,8 +9,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  });
10
10
  };
11
11
  var __generator = (this && this.__generator) || function (thisArg, body) {
12
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
13
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
12
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
13
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
14
  function verb(n) { return function (v) { return step([n, v]); }; }
15
15
  function step(op) {
16
16
  if (f) throw new TypeError("Generator is already executing.");
@@ -36,7 +36,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
36
36
  }
37
37
  };
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.__schemas = exports.__params = exports.__query = exports.__file = exports.__assumedHttpMethod = void 0;
39
+ exports.__params = exports.__query = exports.__file = exports.__assumedHttpMethod = void 0;
40
40
  var flink_1 = require("@flink-app/flink");
41
41
  var putUserPasswordHandler = function (_a) { return __awaiter(void 0, [_a], void 0, function (_b) {
42
42
  var pluginName, repo, resp;
@@ -61,4 +61,3 @@ var putUserPasswordHandler = function (_a) { return __awaiter(void 0, [_a], void
61
61
  }); };
62
62
  exports.default = putUserPasswordHandler;
63
63
  exports.__assumedHttpMethod = "", exports.__file = "UserPasswordPut.ts", exports.__query = [], exports.__params = [];
64
- exports.__schemas = { reqSchema: { "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "additionalProperties": false, "properties": { "password": { "type": "string" } }, "required": ["password"], "definitions": {} }, resSchema: { "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "additionalProperties": false, "properties": { "status": { "type": "string", "enum": ["success", "failed", "passwordError"] } }, "required": ["status"], "definitions": {} } };
@@ -5,4 +5,3 @@ import { UserPasswordResetCompleteRes } from "../schemas/UserPasswordResetComple
5
5
  declare const postPasswordResetCompleteHandler: Handler<FlinkContext<genericAuthContext>, UserPasswordResetCompleteReq, UserPasswordResetCompleteRes>;
6
6
  export default postPasswordResetCompleteHandler;
7
7
  export declare const __assumedHttpMethod = "", __file = "UserPasswordResetComplete.ts", __query: never[], __params: never[];
8
- export declare const __schemas: any;
@@ -9,8 +9,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  });
10
10
  };
11
11
  var __generator = (this && this.__generator) || function (thisArg, body) {
12
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
13
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
12
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
13
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
14
  function verb(n) { return function (v) { return step([n, v]); }; }
15
15
  function step(op) {
16
16
  if (f) throw new TypeError("Generator is already executing.");
@@ -36,7 +36,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
36
36
  }
37
37
  };
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.__schemas = exports.__params = exports.__query = exports.__file = exports.__assumedHttpMethod = void 0;
39
+ exports.__params = exports.__query = exports.__file = exports.__assumedHttpMethod = void 0;
40
40
  var flink_1 = require("@flink-app/flink");
41
41
  var postPasswordResetCompleteHandler = function (_a) { return __awaiter(void 0, [_a], void 0, function (_b) {
42
42
  var pluginName, repo, jwtSecret /*, numberOfDigits, lifeTime*/, resp;
@@ -67,4 +67,3 @@ var postPasswordResetCompleteHandler = function (_a) { return __awaiter(void 0,
67
67
  }); };
68
68
  exports.default = postPasswordResetCompleteHandler;
69
69
  exports.__assumedHttpMethod = "", exports.__file = "UserPasswordResetComplete.ts", exports.__query = [], exports.__params = [];
70
- exports.__schemas = { reqSchema: { "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "additionalProperties": false, "properties": { "passwordResetToken": { "type": "string" }, "code": { "type": "string" }, "password": { "type": "string" } }, "required": ["code", "password", "passwordResetToken"], "definitions": {} }, resSchema: { "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "additionalProperties": false, "properties": { "status": { "type": "string", "enum": ["success", "userNotFound", "invalidCode", "passwordError"] } }, "required": ["status"], "definitions": {} } };
@@ -9,8 +9,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  });
10
10
  };
11
11
  var __generator = (this && this.__generator) || function (thisArg, body) {
12
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
13
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
12
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
13
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
14
  function verb(n) { return function (v) { return step([n, v]); }; }
15
15
  function step(op) {
16
16
  if (f) throw new TypeError("Generator is already executing.");
@@ -39,7 +39,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
39
39
  return (mod && mod.__esModule) ? mod : { "default": mod };
40
40
  };
41
41
  Object.defineProperty(exports, "__esModule", { value: true });
42
- exports.__params = exports.__query = exports.__file = exports.__assumedHttpMethod = exports.resetPasswordFormCss = exports.resetPasswordFormScript = exports.handleUserPasswordResetForm = void 0;
42
+ exports.__params = exports.__query = exports.__file = exports.__assumedHttpMethod = void 0;
43
+ exports.handleUserPasswordResetForm = handleUserPasswordResetForm;
44
+ exports.resetPasswordFormScript = resetPasswordFormScript;
45
+ exports.resetPasswordFormCss = resetPasswordFormCss;
43
46
  var promises_1 = __importDefault(require("fs/promises"));
44
47
  var flink_1 = require("@flink-app/flink");
45
48
  var handlebars_1 = __importDefault(require("handlebars"));
@@ -64,7 +67,6 @@ function handleUserPasswordResetForm(_req_1, res_1, _a) {
64
67
  });
65
68
  });
66
69
  }
67
- exports.handleUserPasswordResetForm = handleUserPasswordResetForm;
68
70
  function resetPasswordFormScript(req_1, res_1, _a) {
69
71
  return __awaiter(this, arguments, void 0, function (req, res, _b) {
70
72
  var js;
@@ -77,7 +79,6 @@ function resetPasswordFormScript(req_1, res_1, _a) {
77
79
  });
78
80
  });
79
81
  }
80
- exports.resetPasswordFormScript = resetPasswordFormScript;
81
82
  function resetPasswordFormCss(res) {
82
83
  return __awaiter(this, void 0, void 0, function () {
83
84
  return __generator(this, function (_a) {
@@ -87,7 +88,6 @@ function resetPasswordFormCss(res) {
87
88
  });
88
89
  });
89
90
  }
90
- exports.resetPasswordFormCss = resetPasswordFormCss;
91
91
  var cachedTemplate = "";
92
92
  function readTemplate(templateFilename) {
93
93
  return __awaiter(this, void 0, void 0, function () {
@@ -6,4 +6,3 @@ import { UserPasswordResetStartResPublic } from "../schemas/UserPasswordResetSta
6
6
  declare const postPasswordResetStartHandler: Handler<FlinkContext<genericAuthContext & emailPluginContext>, UserPasswordResetStartReq, UserPasswordResetStartResPublic>;
7
7
  export default postPasswordResetStartHandler;
8
8
  export declare const __assumedHttpMethod = "", __file = "UserPasswordResetStart.ts", __query: never[], __params: never[];
9
- export declare const __schemas: any;
@@ -9,8 +9,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  });
10
10
  };
11
11
  var __generator = (this && this.__generator) || function (thisArg, body) {
12
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
13
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
12
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
13
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
14
  function verb(n) { return function (v) { return step([n, v]); }; }
15
15
  function step(op) {
16
16
  if (f) throw new TypeError("Generator is already executing.");
@@ -39,7 +39,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
39
39
  return (mod && mod.__esModule) ? mod : { "default": mod };
40
40
  };
41
41
  Object.defineProperty(exports, "__esModule", { value: true });
42
- exports.__schemas = exports.__params = exports.__query = exports.__file = exports.__assumedHttpMethod = void 0;
42
+ exports.__params = exports.__query = exports.__file = exports.__assumedHttpMethod = void 0;
43
43
  var flink_1 = require("@flink-app/flink");
44
44
  var handlebars_1 = __importDefault(require("handlebars"));
45
45
  var postPasswordResetStartHandler = function (_a) { return __awaiter(void 0, [_a], void 0, function (_b) {
@@ -97,4 +97,3 @@ var postPasswordResetStartHandler = function (_a) { return __awaiter(void 0, [_a
97
97
  }); };
98
98
  exports.default = postPasswordResetStartHandler;
99
99
  exports.__assumedHttpMethod = "", exports.__file = "UserPasswordResetStart.ts", exports.__query = [], exports.__params = [];
100
- exports.__schemas = { reqSchema: { "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "additionalProperties": false, "properties": { "username": { "type": "string" }, "template": { "type": "string" }, "additionalAuth": { "type": "string" } }, "required": ["username"], "definitions": {} }, resSchema: { "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "additionalProperties": false, "properties": { "status": { "type": "string", "enum": ["success", "userNotFound"] }, "passwordResetToken": { "type": "string" }, "profile": { "type": "object" } }, "required": ["status"], "definitions": {} } };
@@ -4,4 +4,3 @@ import { UserProfile } from "../schemas/UserProfile";
4
4
  declare const getProfileHandler: Handler<FlinkContext<genericAuthContext>, UserProfile>;
5
5
  export default getProfileHandler;
6
6
  export declare const __assumedHttpMethod = "", __file = "UserProfileGet.ts", __query: never[], __params: never[];
7
- export declare const __schemas: any;
@@ -9,8 +9,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  });
10
10
  };
11
11
  var __generator = (this && this.__generator) || function (thisArg, body) {
12
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
13
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
12
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
13
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
14
  function verb(n) { return function (v) { return step([n, v]); }; }
15
15
  function step(op) {
16
16
  if (f) throw new TypeError("Generator is already executing.");
@@ -36,7 +36,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
36
36
  }
37
37
  };
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.__schemas = exports.__params = exports.__query = exports.__file = exports.__assumedHttpMethod = void 0;
39
+ exports.__params = exports.__query = exports.__file = exports.__assumedHttpMethod = void 0;
40
40
  var flink_1 = require("@flink-app/flink");
41
41
  var getProfileHandler = function (_a) { return __awaiter(void 0, [_a], void 0, function (_b) {
42
42
  var pluginName, repo, userId, user;
@@ -61,4 +61,3 @@ var getProfileHandler = function (_a) { return __awaiter(void 0, [_a], void 0, f
61
61
  }); };
62
62
  exports.default = getProfileHandler;
63
63
  exports.__assumedHttpMethod = "", exports.__file = "UserProfileGet.ts", exports.__query = [], exports.__params = [];
64
- exports.__schemas = { reqSchema: { "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "properties": {}, "definitions": {} }, resSchema: undefined };
@@ -4,4 +4,3 @@ import { UserProfile } from "../schemas/UserProfile";
4
4
  declare const putUserProfileHandler: Handler<FlinkContext<genericAuthContext>, UserProfile, UserProfile>;
5
5
  export default putUserProfileHandler;
6
6
  export declare const __assumedHttpMethod = "", __file = "UserProfilePut.ts", __query: never[], __params: never[];
7
- export declare const __schemas: any;
@@ -20,8 +20,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
20
20
  });
21
21
  };
22
22
  var __generator = (this && this.__generator) || function (thisArg, body) {
23
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
24
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
23
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
24
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
25
25
  function verb(n) { return function (v) { return step([n, v]); }; }
26
26
  function step(op) {
27
27
  if (f) throw new TypeError("Generator is already executing.");
@@ -47,7 +47,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
47
47
  }
48
48
  };
49
49
  Object.defineProperty(exports, "__esModule", { value: true });
50
- exports.__schemas = exports.__params = exports.__query = exports.__file = exports.__assumedHttpMethod = void 0;
50
+ exports.__params = exports.__query = exports.__file = exports.__assumedHttpMethod = void 0;
51
51
  var flink_1 = require("@flink-app/flink");
52
52
  var putUserProfileHandler = function (_a) { return __awaiter(void 0, [_a], void 0, function (_b) {
53
53
  var pluginName, repo, userId, user, updatedProfile;
@@ -71,12 +71,16 @@ var putUserProfileHandler = function (_a) { return __awaiter(void 0, [_a], void
71
71
  return [4 /*yield*/, repo.getById(userId)];
72
72
  case 3:
73
73
  user = _c.sent();
74
- return [2 /*return*/, {
75
- data: user.profile,
76
- }];
74
+ if (!ctx.plugins[pluginName].onUserUpdated) return [3 /*break*/, 5];
75
+ return [4 /*yield*/, ctx.plugins[pluginName].onUserUpdated(user, req.body)];
76
+ case 4:
77
+ _c.sent();
78
+ _c.label = 5;
79
+ case 5: return [2 /*return*/, {
80
+ data: user.profile,
81
+ }];
77
82
  }
78
83
  });
79
84
  }); };
80
85
  exports.default = putUserProfileHandler;
81
86
  exports.__assumedHttpMethod = "", exports.__file = "UserProfilePut.ts", exports.__query = [], exports.__params = [];
82
- exports.__schemas = { reqSchema: { "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "properties": {}, "definitions": {} }, resSchema: { "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "properties": {}, "definitions": {} } };
@@ -5,4 +5,3 @@ import { PushNotificatioNTokenRes } from "../schemas/PushNotificationTokenRes";
5
5
  declare const postUserPushRegisterTokenHandler: Handler<FlinkContext<genericAuthContext>, PushNotificationToken, PushNotificatioNTokenRes>;
6
6
  export default postUserPushRegisterTokenHandler;
7
7
  export declare const __assumedHttpMethod = "", __file = "UserPushRegisterToken.ts", __query: never[], __params: never[];
8
- export declare const __schemas: any;
@@ -20,8 +20,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
20
20
  });
21
21
  };
22
22
  var __generator = (this && this.__generator) || function (thisArg, body) {
23
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
24
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
23
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
24
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
25
25
  function verb(n) { return function (v) { return step([n, v]); }; }
26
26
  function step(op) {
27
27
  if (f) throw new TypeError("Generator is already executing.");
@@ -47,7 +47,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
47
47
  }
48
48
  };
49
49
  Object.defineProperty(exports, "__esModule", { value: true });
50
- exports.__schemas = exports.__params = exports.__query = exports.__file = exports.__assumedHttpMethod = void 0;
50
+ exports.__params = exports.__query = exports.__file = exports.__assumedHttpMethod = void 0;
51
51
  var flink_1 = require("@flink-app/flink");
52
52
  var postUserPushRegisterTokenHandler = function (_a) { return __awaiter(void 0, [_a], void 0, function (_b) {
53
53
  var pluginName, pluginOptions, repo, deregisterOtherDevices, allowMultipleDevices, user, exToken, otherRegistrations, _i, otherRegistrations_1, other, lengthBefore, e_1;
@@ -87,7 +87,7 @@ var postUserPushRegisterTokenHandler = function (_a) { return __awaiter(void 0,
87
87
  if (!deregisterOtherDevices) return [3 /*break*/, 9];
88
88
  return [4 /*yield*/, repo.findAll({
89
89
  $or: [{ "pushNotificationTokens.deviceId": req.body.deviceId }, { "pushNotificationTokens.token": req.body.token }],
90
- _id: { $ne: user._id },
90
+ _id: { $ne: repo.buildId(user._id) },
91
91
  })];
92
92
  case 3:
93
93
  otherRegistrations = _d.sent();
@@ -122,4 +122,3 @@ var postUserPushRegisterTokenHandler = function (_a) { return __awaiter(void 0,
122
122
  }); };
123
123
  exports.default = postUserPushRegisterTokenHandler;
124
124
  exports.__assumedHttpMethod = "", exports.__file = "UserPushRegisterToken.ts", exports.__query = [], exports.__params = [];
125
- exports.__schemas = { reqSchema: { "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "additionalProperties": false, "properties": { "deviceId": { "type": "string" }, "token": { "type": "string" }, "platform": { "type": "string", "enum": ["ios", "android", "web"] }, "type": { "type": "string", "enum": ["firebase", "apn-voip"] } }, "required": ["deviceId", "token"], "definitions": {} }, resSchema: { "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "additionalProperties": false, "properties": { "status": { "type": "string", "enum": ["success", "failed"] } }, "required": ["status"], "definitions": {} } };
@@ -5,4 +5,3 @@ import { PushNotificatioNTokenRes } from "../schemas/PushNotificationTokenRes";
5
5
  declare const postUserRemoveTokenHandler: Handler<FlinkContext<genericAuthContext>, PushNotificationToken, PushNotificatioNTokenRes>;
6
6
  export default postUserRemoveTokenHandler;
7
7
  export declare const __assumedHttpMethod = "", __file = "UserPushRemoveToken.ts", __query: never[], __params: never[];
8
- export declare const __schemas: any;
@@ -9,8 +9,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  });
10
10
  };
11
11
  var __generator = (this && this.__generator) || function (thisArg, body) {
12
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
13
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
12
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
13
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
14
  function verb(n) { return function (v) { return step([n, v]); }; }
15
15
  function step(op) {
16
16
  if (f) throw new TypeError("Generator is already executing.");
@@ -36,7 +36,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
36
36
  }
37
37
  };
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.__schemas = exports.__params = exports.__query = exports.__file = exports.__assumedHttpMethod = void 0;
39
+ exports.__params = exports.__query = exports.__file = exports.__assumedHttpMethod = void 0;
40
40
  var flink_1 = require("@flink-app/flink");
41
41
  var postUserRemoveTokenHandler = function (_a) { return __awaiter(void 0, [_a], void 0, function (_b) {
42
42
  var pluginName, repo, user;
@@ -64,4 +64,3 @@ var postUserRemoveTokenHandler = function (_a) { return __awaiter(void 0, [_a],
64
64
  }); };
65
65
  exports.default = postUserRemoveTokenHandler;
66
66
  exports.__assumedHttpMethod = "", exports.__file = "UserPushRemoveToken.ts", exports.__query = [], exports.__params = [];
67
- exports.__schemas = { reqSchema: { "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "additionalProperties": false, "properties": { "deviceId": { "type": "string" }, "token": { "type": "string" }, "platform": { "type": "string", "enum": ["ios", "android", "web"] }, "type": { "type": "string", "enum": ["firebase", "apn-voip"] } }, "required": ["deviceId", "token"], "definitions": {} }, resSchema: { "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "additionalProperties": false, "properties": { "status": { "type": "string", "enum": ["success", "failed"] } }, "required": ["status"], "definitions": {} } };
@@ -4,4 +4,3 @@ import { UserTokenRes } from "../schemas/UserTokenRes";
4
4
  declare const getUserTokenHandler: Handler<FlinkContext<genericAuthContext>, UserTokenRes>;
5
5
  export default getUserTokenHandler;
6
6
  export declare const __assumedHttpMethod = "", __file = "UserToken.ts", __query: never[], __params: never[];
7
- export declare const __schemas: any;
@@ -9,8 +9,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  });
10
10
  };
11
11
  var __generator = (this && this.__generator) || function (thisArg, body) {
12
- var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
13
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
12
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
13
+ return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
14
14
  function verb(n) { return function (v) { return step([n, v]); }; }
15
15
  function step(op) {
16
16
  if (f) throw new TypeError("Generator is already executing.");
@@ -36,7 +36,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
36
36
  }
37
37
  };
38
38
  Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.__schemas = exports.__params = exports.__query = exports.__file = exports.__assumedHttpMethod = void 0;
39
+ exports.__params = exports.__query = exports.__file = exports.__assumedHttpMethod = void 0;
40
40
  var flink_1 = require("@flink-app/flink");
41
41
  var getUserTokenHandler = function (_a) { return __awaiter(void 0, [_a], void 0, function (_b) {
42
42
  var pluginName, repo, user, token;
@@ -64,4 +64,3 @@ var getUserTokenHandler = function (_a) { return __awaiter(void 0, [_a], void 0,
64
64
  }); };
65
65
  exports.default = getUserTokenHandler;
66
66
  exports.__assumedHttpMethod = "", exports.__file = "UserToken.ts", exports.__query = [], exports.__params = [];
67
- exports.__schemas = { reqSchema: { "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "additionalProperties": false, "properties": { "token": { "type": "string" } }, "required": ["token"], "definitions": {} }, resSchema: undefined };
package/dist/src/index.js CHANGED
@@ -47,11 +47,11 @@ __exportStar(require("./management"), exports);
47
47
  var genericAuthPlugin = function (options) {
48
48
  if (options.pluginId == null)
49
49
  options.pluginId = "genericAuthPlugin";
50
- var sms = options.sms, usernameFormat = options.usernameFormat, restOptions = __rest(options, ["sms", "usernameFormat"]);
50
+ var sms = options.sms, usernameFormat = options.usernameFormat, onUserUpdated = options.onUserUpdated, restOptions = __rest(options, ["sms", "usernameFormat", "onUserUpdated"]);
51
51
  return {
52
52
  id: options.pluginId,
53
53
  init: function (app) { return (0, init_1.init)(app, options); },
54
- ctx: __assign(__assign({}, restOptions), { loginUser: coreFunctions_1.loginUser, loginByToken: coreFunctions_1.loginByToken, createUser: coreFunctions_1.createUser, changePassword: coreFunctions_1.changePassword, passwordResetStart: coreFunctions_1.passwordResetStart, passwordResetComplete: coreFunctions_1.passwordResetComplete, usernameFormat: usernameFormat || /.{1,}$/, smsOptions: sms }),
54
+ ctx: __assign(__assign({}, restOptions), { loginUser: coreFunctions_1.loginUser, loginByToken: coreFunctions_1.loginByToken, createUser: coreFunctions_1.createUser, changePassword: coreFunctions_1.changePassword, passwordResetStart: coreFunctions_1.passwordResetStart, passwordResetComplete: coreFunctions_1.passwordResetComplete, usernameFormat: usernameFormat || /.{1,}$/, smsOptions: sms, onUserUpdated: onUserUpdated }),
55
55
  };
56
56
  };
57
57
  exports.genericAuthPlugin = genericAuthPlugin;
package/dist/src/init.js CHANGED
@@ -23,7 +23,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
23
23
  return result;
24
24
  };
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.init = void 0;
26
+ exports.init = init;
27
27
  var flink_1 = require("@flink-app/flink");
28
28
  var userLoginHandler = __importStar(require("./handlers/UserLogin"));
29
29
  var userLoginByTokenHandler = __importStar(require("./handlers/UserLoginByToken"));
@@ -130,7 +130,7 @@ function init(app, options) {
130
130
  (_c = app.expressApp) === null || _c === void 0 ? void 0 : _c.get(options.baseUrl + "/password/reset/form/script.js", function (req, res) {
131
131
  (0, UserPasswordResetForm_1.resetPasswordFormScript)(req, res, { completeUrl: options.baseUrl + "/password/reset/complete" });
132
132
  });
133
- (_d = app.expressApp) === null || _d === void 0 ? void 0 : _d.get(options.baseUrl + "/password/reset/form/style.css", function (req, res) {
133
+ (_d = app.expressApp) === null || _d === void 0 ? void 0 : _d.get(options.baseUrl + "/password/reset/form/style.css", function (_req, res) {
134
134
  (0, UserPasswordResetForm_1.resetPasswordFormCss)(res);
135
135
  });
136
136
  }
@@ -153,4 +153,3 @@ function init(app, options) {
153
153
  }
154
154
  }
155
155
  }
156
- exports.init = init;
@@ -3,11 +3,12 @@ import { UserProfile } from "./UserProfile";
3
3
  export interface User {
4
4
  _id: string;
5
5
  username: string;
6
+ personalNumber?: string;
6
7
  password?: string;
7
8
  salt?: string;
8
9
  pwdResetStartedAt?: string | null;
9
10
  roles: string[];
10
- authentificationMethod: "password" | "sms";
11
+ authentificationMethod: "password" | "sms" | "bankid";
11
12
  profile: UserProfile;
12
13
  pushNotificationTokens: Array<PushNotificationToken>;
13
14
  }
@@ -2,6 +2,7 @@ import { UserProfile } from "./UserProfile";
2
2
  export interface UserCreateReq {
3
3
  username: string;
4
4
  password?: string;
5
- authentificationMethod?: "password" | "sms";
5
+ personalNumber?: string;
6
+ authentificationMethod?: "password" | "sms" | "bankid";
6
7
  profile?: UserProfile;
7
8
  }
@@ -1,3 +1,7 @@
1
1
  export interface UserPasswordResetCompleteRes {
2
2
  status: "success" | "userNotFound" | "invalidCode" | "passwordError";
3
+ /**
4
+ * The user object is returned only if the status is "success".
5
+ */
6
+ user?: any;
3
7
  }
package/package.json CHANGED
@@ -1,34 +1,33 @@
1
1
  {
2
- "name": "@flink-app/generic-auth-plugin",
3
- "version": "0.12.1-alpha.9",
4
- "description": "Flink plugin that provides a generic user authentification solution.",
5
- "scripts": {
6
- "test": "echo \"Error: no test specified\"",
7
- "build": "flink build",
8
- "prepare": "npm run build",
9
- "watch": "nodemon --exec \"flink build\""
10
- },
11
- "author": "johan@frost.se",
12
- "publishConfig": {
13
- "access": "public"
14
- },
15
- "license": "MIT",
16
- "types": "dist/src/index.d.ts",
17
- "main": "dist/src/index.js",
18
- "dependencies": {
19
- "@flink-app/email-plugin": "^0.12.1-alpha.9",
20
- "@flink-app/jwt-auth-plugin": "^0.12.1-alpha.9",
21
- "@flink-app/management-api-plugin": "^0.12.1-alpha.9",
22
- "@flink-app/sms-plugin": "^0.12.1-alpha.9",
23
- "handlebars": "^4.7.7",
24
- "jsonwebtoken": "^8.5.1"
25
- },
26
- "devDependencies": {
27
- "@flink-app/flink": "^0.12.1-alpha.9",
28
- "@types/jsonwebtoken": "^8.5.2",
29
- "@types/node": "22.13.10",
30
- "ts-node": "^9.1.1",
31
- "typescript": "5.4.5"
32
- },
33
- "gitHead": "3007ad036607014176930446fde56203bde8d6f5"
34
- }
2
+ "name": "@flink-app/generic-auth-plugin",
3
+ "version": "0.13.0",
4
+ "description": "Flink plugin that provides a generic user authentification solution.",
5
+ "author": "johan@frost.se",
6
+ "publishConfig": {
7
+ "access": "public"
8
+ },
9
+ "license": "MIT",
10
+ "types": "dist/src/index.d.ts",
11
+ "main": "dist/src/index.js",
12
+ "dependencies": {
13
+ "handlebars": "^4.7.7",
14
+ "jsonwebtoken": "^8.5.1",
15
+ "@flink-app/sms-plugin": "0.13.0",
16
+ "@flink-app/email-plugin": "0.13.0",
17
+ "@flink-app/management-api-plugin": "0.13.0",
18
+ "@flink-app/jwt-auth-plugin": "0.13.0"
19
+ },
20
+ "devDependencies": {
21
+ "@types/jsonwebtoken": "^8.5.2",
22
+ "@types/node": "22.13.10",
23
+ "ts-node": "^10.9.2",
24
+ "@flink-app/flink": "0.13.0"
25
+ },
26
+ "gitHead": "4243e3b3cd6d4e1ca001a61baa8436bf2bbe4113",
27
+ "scripts": {
28
+ "test": "echo \"Error: no test specified\"",
29
+ "build": "flink build",
30
+ "watch": "nodemon --exec \"flink build\"",
31
+ "clean": "rimraf dist .flink"
32
+ }
33
+ }