@flink-app/generic-auth-plugin 0.7.0-alpha.0 → 0.11.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 (61) hide show
  1. package/.flink/generatedHandlers.ts +24 -1
  2. package/.flink/generatedJobs.ts +1 -1
  3. package/.flink/generatedRepos.ts +1 -1
  4. package/.flink/schemas/schemas.json +607 -1
  5. package/.flink/schemas/schemas.ts +1 -1
  6. package/.flink/start.ts +1 -1
  7. package/dist/.flink/generatedHandlers.js +1 -1
  8. package/dist/.flink/generatedJobs.js +1 -1
  9. package/dist/.flink/generatedRepos.js +1 -1
  10. package/dist/.flink/schemas/schemas.json +607 -1
  11. package/dist/.flink/start.js +1 -1
  12. package/dist/src/coreFunctions.js +8 -3
  13. package/dist/src/handlers/Management/DeleteUserByUserid.d.ts +2 -0
  14. package/dist/src/handlers/Management/DeleteUserByUserid.js +3 -0
  15. package/dist/src/handlers/Management/GetSchema.d.ts +2 -0
  16. package/dist/src/handlers/Management/GetSchema.js +3 -0
  17. package/dist/src/handlers/Management/GetUser.d.ts +2 -0
  18. package/dist/src/handlers/Management/GetUser.js +3 -0
  19. package/dist/src/handlers/Management/GetUserByUserid.d.ts +2 -0
  20. package/dist/src/handlers/Management/GetUserByUserid.js +3 -0
  21. package/dist/src/handlers/Management/GetUserViewByUserid.d.ts +2 -0
  22. package/dist/src/handlers/Management/GetUserViewByUserid.js +3 -0
  23. package/dist/src/handlers/Management/PutUserPasswordByUserid.d.ts +2 -0
  24. package/dist/src/handlers/Management/PutUserPasswordByUserid.js +3 -0
  25. package/dist/src/handlers/Management/PutUserProfileByUserid.d.ts +2 -0
  26. package/dist/src/handlers/Management/PutUserProfileByUserid.js +3 -0
  27. package/dist/src/handlers/Management/PutUserProfileByUseridAppend.d.ts +2 -0
  28. package/dist/src/handlers/Management/PutUserProfileByUseridAppend.js +3 -0
  29. package/dist/src/handlers/Management/PutUserRolesByUserid.d.ts +2 -0
  30. package/dist/src/handlers/Management/PutUserRolesByUserid.js +3 -0
  31. package/dist/src/handlers/Management/PutUserUsernameByUserid.d.ts +2 -0
  32. package/dist/src/handlers/Management/PutUserUsernameByUserid.js +3 -0
  33. package/dist/src/handlers/UserCreate.d.ts +2 -0
  34. package/dist/src/handlers/UserCreate.js +3 -0
  35. package/dist/src/handlers/UserLogin.d.ts +2 -0
  36. package/dist/src/handlers/UserLogin.js +3 -0
  37. package/dist/src/handlers/UserLoginByToken.d.ts +2 -0
  38. package/dist/src/handlers/UserLoginByToken.js +3 -0
  39. package/dist/src/handlers/UserPasswordPut.d.ts +2 -0
  40. package/dist/src/handlers/UserPasswordPut.js +3 -0
  41. package/dist/src/handlers/UserPasswordResetComplete.d.ts +2 -0
  42. package/dist/src/handlers/UserPasswordResetComplete.js +3 -0
  43. package/dist/src/handlers/UserPasswordResetForm.d.ts +1 -0
  44. package/dist/src/handlers/UserPasswordResetForm.js +2 -1
  45. package/dist/src/handlers/UserPasswordResetStart.d.ts +2 -0
  46. package/dist/src/handlers/UserPasswordResetStart.js +14 -7
  47. package/dist/src/handlers/UserProfileGet.d.ts +2 -0
  48. package/dist/src/handlers/UserProfileGet.js +3 -0
  49. package/dist/src/handlers/UserProfilePut.d.ts +2 -0
  50. package/dist/src/handlers/UserProfilePut.js +3 -0
  51. package/dist/src/handlers/UserPushRegisterToken.d.ts +2 -0
  52. package/dist/src/handlers/UserPushRegisterToken.js +3 -0
  53. package/dist/src/handlers/UserPushRemoveToken.d.ts +2 -0
  54. package/dist/src/handlers/UserPushRemoveToken.js +3 -0
  55. package/dist/src/handlers/UserToken.d.ts +2 -0
  56. package/dist/src/handlers/UserToken.js +3 -0
  57. package/dist/src/schemas/UserPasswordResetSettings.d.ts +14 -5
  58. package/package.json +7 -7
  59. package/src/coreFunctions.ts +11 -2
  60. package/src/handlers/UserPasswordResetStart.ts +41 -49
  61. package/src/schemas/UserPasswordResetSettings.ts +21 -10
@@ -36,6 +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
40
  var GetSchema = function (_a) {
40
41
  var ctx = _a.ctx, req = _a.req, origin = _a.origin;
41
42
  return __awaiter(void 0, void 0, void 0, function () {
@@ -51,3 +52,5 @@ var GetSchema = function (_a) {
51
52
  });
52
53
  };
53
54
  exports.default = GetSchema;
55
+ exports.__assumedHttpMethod = "get", exports.__file = "GetSchema.ts", exports.__query = [], exports.__params = [];
56
+ exports.__schemas = { reqSchema: undefined, resSchema: undefined };
@@ -3,3 +3,5 @@ import { GetManagementUserReq } from "../../schemas/Management/GetUserReq";
3
3
  import { GetManagementUserRes } from "../../schemas/Management/GetUserRes";
4
4
  declare const GetManagementUser: Handler<FlinkContext, GetManagementUserReq, GetManagementUserRes>;
5
5
  export default GetManagementUser;
6
+ export declare const __assumedHttpMethod = "get", __file = "GetUser.ts", __query: never[], __params: never[];
7
+ export declare const __schemas: any;
@@ -36,6 +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
40
  var GetManagementUser = function (_a) {
40
41
  var ctx = _a.ctx, req = _a.req, origin = _a.origin;
41
42
  return __awaiter(void 0, void 0, void 0, function () {
@@ -60,3 +61,5 @@ var GetManagementUser = function (_a) {
60
61
  });
61
62
  };
62
63
  exports.default = GetManagementUser;
64
+ exports.__assumedHttpMethod = "get", exports.__file = "GetUser.ts", exports.__query = [], exports.__params = [];
65
+ exports.__schemas = { reqSchema: { "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "additionalProperties": false, "properties": {}, "definitions": {} }, resSchema: { "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "additionalProperties": false, "properties": { "users": { "type": "array", "items": { "type": "object", "properties": { "_id": { "type": "string" }, "username": { "type": "string" } }, "required": ["_id", "username"], "additionalProperties": false } } }, "required": ["users"], "definitions": {} } };
@@ -2,3 +2,5 @@ import { FlinkContext, Handler } from "@flink-app/flink";
2
2
  import { GetManagementUserByUseridReq } from "../../schemas/Management/GetUserByUseridReq";
3
3
  declare const GetManagementUserByUserid: Handler<FlinkContext, GetManagementUserByUseridReq, any>;
4
4
  export default GetManagementUserByUserid;
5
+ export declare const __assumedHttpMethod = "get", __file = "GetUserByUserid.ts", __query: never[], __params: never[];
6
+ export declare const __schemas: any;
@@ -47,6 +47,7 @@ var __rest = (this && this.__rest) || function (s, e) {
47
47
  return t;
48
48
  };
49
49
  Object.defineProperty(exports, "__esModule", { value: true });
50
+ exports.__schemas = exports.__params = exports.__query = exports.__file = exports.__assumedHttpMethod = void 0;
50
51
  var flink_1 = require("@flink-app/flink");
51
52
  var GetManagementUserByUserid = function (_a) {
52
53
  var ctx = _a.ctx, req = _a.req, origin = _a.origin;
@@ -73,3 +74,5 @@ var GetManagementUserByUserid = function (_a) {
73
74
  });
74
75
  };
75
76
  exports.default = GetManagementUserByUserid;
77
+ exports.__assumedHttpMethod = "get", exports.__file = "GetUserByUserid.ts", exports.__query = [], exports.__params = [];
78
+ exports.__schemas = { reqSchema: { "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "additionalProperties": false, "properties": {}, "definitions": {} }, resSchema: undefined };
@@ -3,3 +3,5 @@ import { GetManagementUserViewByUseridReq } from "../../schemas/Management/GetUs
3
3
  import { GetManagementUserViewByUseridRes } from "../../schemas/Management/GetUserViewByUseridRes";
4
4
  declare const GetManagementUserByUserid: Handler<FlinkContext, GetManagementUserViewByUseridReq, GetManagementUserViewByUseridRes>;
5
5
  export default GetManagementUserByUserid;
6
+ export declare const __assumedHttpMethod = "get", __file = "GetUserViewByUserid.ts", __query: never[], __params: never[];
7
+ export declare const __schemas: any;
@@ -36,6 +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
40
  var flink_1 = require("@flink-app/flink");
40
41
  var GetManagementUserByUserid = function (_a) {
41
42
  var ctx = _a.ctx, req = _a.req, origin = _a.origin;
@@ -75,3 +76,5 @@ var GetManagementUserByUserid = function (_a) {
75
76
  });
76
77
  };
77
78
  exports.default = GetManagementUserByUserid;
79
+ exports.__assumedHttpMethod = "get", exports.__file = "GetUserViewByUserid.ts", exports.__query = [], exports.__params = [];
80
+ exports.__schemas = { reqSchema: { "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "additionalProperties": false, "properties": {}, "definitions": {} }, resSchema: { "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "additionalProperties": false, "properties": { "buttons": { "type": "array", "items": { "type": "object", "properties": { "text": { "type": "string" }, "url": { "type": "string" } }, "required": ["text", "url"], "additionalProperties": false } }, "data": { "type": "object", "additionalProperties": { "type": "string" } } }, "required": ["buttons", "data"], "definitions": {} } };
@@ -3,3 +3,5 @@ import { PutManagementUserPasswordByUseridReq } from "../../schemas/Management/P
3
3
  import { PutManagementUserPasswordByUseridRes } from "../../schemas/Management/PutUserPasswordByUseridRes";
4
4
  declare const PutManagementUserPasswordByUserid: Handler<FlinkContext, PutManagementUserPasswordByUseridReq, PutManagementUserPasswordByUseridRes>;
5
5
  export default PutManagementUserPasswordByUserid;
6
+ export declare const __assumedHttpMethod = "put", __file = "PutUserPasswordByUserid.ts", __query: never[], __params: never[];
7
+ export declare const __schemas: any;
@@ -36,6 +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
40
  var flink_1 = require("@flink-app/flink");
40
41
  var PutManagementUserPasswordByUserid = function (_a) {
41
42
  var ctx = _a.ctx, req = _a.req, origin = _a.origin;
@@ -86,3 +87,5 @@ var PutManagementUserPasswordByUserid = function (_a) {
86
87
  });
87
88
  };
88
89
  exports.default = PutManagementUserPasswordByUserid;
90
+ exports.__assumedHttpMethod = "put", exports.__file = "PutUserPasswordByUserid.ts", exports.__query = [], exports.__params = [];
91
+ 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": {}, "definitions": {} } };
@@ -3,3 +3,5 @@ import { PutManagementUserProfileByUseridReq } from "../../schemas/Management/Pu
3
3
  import { PutManagementUserProfileByUseridRes } from "../../schemas/Management/PutUserProfileByUseridRes";
4
4
  declare const PutManagementUserProfileByUserid: Handler<FlinkContext, PutManagementUserProfileByUseridReq, PutManagementUserProfileByUseridRes>;
5
5
  export default PutManagementUserProfileByUserid;
6
+ export declare const __assumedHttpMethod = "put", __file = "PutUserProfileByUserid.ts", __query: never[], __params: never[];
7
+ export declare const __schemas: any;
@@ -36,6 +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
40
  var flink_1 = require("@flink-app/flink");
40
41
  var PutManagementUserProfileByUserid = function (_a) {
41
42
  var ctx = _a.ctx, req = _a.req, origin = _a.origin;
@@ -64,3 +65,5 @@ var PutManagementUserProfileByUserid = function (_a) {
64
65
  });
65
66
  };
66
67
  exports.default = PutManagementUserProfileByUserid;
68
+ exports.__assumedHttpMethod = "put", exports.__file = "PutUserProfileByUserid.ts", exports.__query = [], exports.__params = [];
69
+ 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", "additionalProperties": false, "properties": {}, "definitions": {} } };
@@ -3,3 +3,5 @@ import { PutManagementUserProfileByUseridReq } from "../../schemas/Management/Pu
3
3
  import { PutManagementUserProfileByUseridRes } from "../../schemas/Management/PutUserProfileByUseridRes";
4
4
  declare const PutManagementUserProfileByUserid: Handler<FlinkContext, PutManagementUserProfileByUseridReq, PutManagementUserProfileByUseridRes>;
5
5
  export default PutManagementUserProfileByUserid;
6
+ export declare const __assumedHttpMethod = "put", __file = "PutUserProfileByUseridAppend.ts", __query: never[], __params: never[];
7
+ export declare const __schemas: any;
@@ -47,6 +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
51
  var flink_1 = require("@flink-app/flink");
51
52
  var PutManagementUserProfileByUserid = function (_a) {
52
53
  var ctx = _a.ctx, req = _a.req, origin = _a.origin;
@@ -78,3 +79,5 @@ var PutManagementUserProfileByUserid = function (_a) {
78
79
  });
79
80
  };
80
81
  exports.default = PutManagementUserProfileByUserid;
82
+ exports.__assumedHttpMethod = "put", exports.__file = "PutUserProfileByUseridAppend.ts", exports.__query = [], exports.__params = [];
83
+ 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", "additionalProperties": false, "properties": {}, "definitions": {} } };
@@ -3,3 +3,5 @@ import { PutManagementUserRolesByUseridReq } from "../../schemas/Management/PutU
3
3
  import { PutManagementUserRolesByUseridRes } from "../../schemas/Management/PutUserRolesByUseridRes";
4
4
  declare const PutManagementUserRolesByUserid: Handler<FlinkContext, PutManagementUserRolesByUseridReq, PutManagementUserRolesByUseridRes>;
5
5
  export default PutManagementUserRolesByUserid;
6
+ export declare const __assumedHttpMethod = "put", __file = "PutUserRolesByUserid.ts", __query: never[], __params: never[];
7
+ export declare const __schemas: any;
@@ -36,6 +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
40
  var flink_1 = require("@flink-app/flink");
40
41
  var PutManagementUserRolesByUserid = function (_a) {
41
42
  var ctx = _a.ctx, req = _a.req, origin = _a.origin;
@@ -64,3 +65,5 @@ var PutManagementUserRolesByUserid = function (_a) {
64
65
  });
65
66
  };
66
67
  exports.default = PutManagementUserRolesByUserid;
68
+ exports.__assumedHttpMethod = "put", exports.__file = "PutUserRolesByUserid.ts", exports.__query = [], exports.__params = [];
69
+ exports.__schemas = { reqSchema: { "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "additionalProperties": false, "properties": { "roles": { "type": "array", "items": { "type": "string" } } }, "required": ["roles"], "definitions": {} }, resSchema: { "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "additionalProperties": false, "properties": {}, "definitions": {} } };
@@ -3,3 +3,5 @@ import { PutManagementUserUsernameByUseridReq } from "../../schemas/Management/P
3
3
  import { PutManagementUserUsernameByUseridRes } from "../../schemas/Management/PutUserUsernameByUseridRes";
4
4
  declare const PutManagementUserUsernameByUserid: Handler<FlinkContext, PutManagementUserUsernameByUseridReq, PutManagementUserUsernameByUseridRes>;
5
5
  export default PutManagementUserUsernameByUserid;
6
+ export declare const __assumedHttpMethod = "put", __file = "PutUserUsernameByUserid.ts", __query: never[], __params: never[];
7
+ export declare const __schemas: any;
@@ -36,6 +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
40
  var flink_1 = require("@flink-app/flink");
40
41
  var PutManagementUserUsernameByUserid = function (_a) {
41
42
  var ctx = _a.ctx, req = _a.req, origin = _a.origin;
@@ -74,3 +75,5 @@ var PutManagementUserUsernameByUserid = function (_a) {
74
75
  });
75
76
  };
76
77
  exports.default = PutManagementUserUsernameByUserid;
78
+ exports.__assumedHttpMethod = "put", exports.__file = "PutUserUsernameByUserid.ts", exports.__query = [], exports.__params = [];
79
+ exports.__schemas = { reqSchema: { "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "additionalProperties": false, "properties": { "username": { "type": "string" } }, "required": ["username"], "definitions": {} }, resSchema: { "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "additionalProperties": false, "properties": {}, "definitions": {} } };
@@ -4,3 +4,5 @@ import { UserCreateReq } from "../schemas/UserCreateReq";
4
4
  import { UserCreateRes } from "../schemas/UserCreateRes";
5
5
  declare const userCreateHandler: Handler<FlinkContext<genericAuthContext>, UserCreateReq, UserCreateRes>;
6
6
  export default userCreateHandler;
7
+ export declare const __assumedHttpMethod = "", __file = "UserCreate.ts", __query: never[], __params: never[];
8
+ export declare const __schemas: any;
@@ -36,6 +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
40
  var flink_1 = require("@flink-app/flink");
40
41
  var userCreateHandler = function (_a) {
41
42
  var ctx = _a.ctx, req = _a.req, origin = _a.origin;
@@ -85,3 +86,5 @@ var userCreateHandler = function (_a) {
85
86
  });
86
87
  };
87
88
  exports.default = userCreateHandler;
89
+ exports.__assumedHttpMethod = "", exports.__file = "UserCreate.ts", exports.__query = [], exports.__params = [];
90
+ exports.__schemas = { reqSchema: { "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "additionalProperties": false, "properties": { "username": { "type": "string" }, "password": { "type": "string" }, "authentificationMethod": { "type": "string", "enum": ["password", "sms"] }, "profile": { "type": "object" } }, "required": ["username"], "definitions": {} }, resSchema: { "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "additionalProperties": false, "properties": { "status": { "type": "string", "enum": ["success", "error", "userExists", "passwordError"] }, "user": { "type": "object", "properties": { "_id": { "type": "string" }, "username": { "type": "string" }, "token": { "type": "string" } }, "required": ["_id", "username", "token"], "additionalProperties": false } }, "required": ["status"], "definitions": {} } };
@@ -4,3 +4,5 @@ import { UserLoginReq } from "../schemas/UserLoginReq";
4
4
  import { UserLoginRes } from "../schemas/UserLoginRes";
5
5
  declare const userLoginHandler: Handler<FlinkContext<genericAuthContext>, UserLoginReq, UserLoginRes>;
6
6
  export default userLoginHandler;
7
+ export declare const __assumedHttpMethod = "", __file = "UserLogin.ts", __query: never[], __params: never[];
8
+ export declare const __schemas: any;
@@ -36,6 +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
40
  var flink_1 = require("@flink-app/flink");
40
41
  var userLoginHandler = function (_a) {
41
42
  var ctx = _a.ctx, req = _a.req, origin = _a.origin;
@@ -64,3 +65,5 @@ var userLoginHandler = function (_a) {
64
65
  });
65
66
  };
66
67
  exports.default = userLoginHandler;
68
+ exports.__assumedHttpMethod = "", exports.__file = "UserLogin.ts", exports.__query = [], exports.__params = [];
69
+ 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": {} } };
@@ -4,3 +4,5 @@ import { UserLoginByTokenReq } from "../schemas/UserLoginByTokenReq";
4
4
  import { UserLoginRes } from "../schemas/UserLoginRes";
5
5
  declare const userLoginHandler: Handler<FlinkContext<genericAuthContext>, UserLoginByTokenReq, UserLoginRes>;
6
6
  export default userLoginHandler;
7
+ export declare const __assumedHttpMethod = "", __file = "UserLoginByToken.ts", __query: never[], __params: never[];
8
+ export declare const __schemas: any;
@@ -36,6 +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
40
  var flink_1 = require("@flink-app/flink");
40
41
  var userLoginHandler = function (_a) {
41
42
  var ctx = _a.ctx, req = _a.req, origin = _a.origin;
@@ -64,3 +65,5 @@ var userLoginHandler = function (_a) {
64
65
  });
65
66
  };
66
67
  exports.default = userLoginHandler;
68
+ exports.__assumedHttpMethod = "", exports.__file = "UserLoginByToken.ts", exports.__query = [], exports.__params = [];
69
+ 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": {} } };
@@ -4,3 +4,5 @@ import { UserPasswordChangeReq } from "../schemas/UserPasswordChangeReq";
4
4
  import { UserPasswordChangeRes } from "../schemas/UserPasswordChangeRes";
5
5
  declare const putUserPasswordHandler: Handler<FlinkContext<genericAuthContext>, UserPasswordChangeReq, UserPasswordChangeRes>;
6
6
  export default putUserPasswordHandler;
7
+ export declare const __assumedHttpMethod = "", __file = "UserPasswordPut.ts", __query: never[], __params: never[];
8
+ export declare const __schemas: any;
@@ -36,6 +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
40
  var flink_1 = require("@flink-app/flink");
40
41
  var putUserPasswordHandler = function (_a) {
41
42
  var ctx = _a.ctx, req = _a.req, origin = _a.origin;
@@ -61,3 +62,5 @@ var putUserPasswordHandler = function (_a) {
61
62
  });
62
63
  };
63
64
  exports.default = putUserPasswordHandler;
65
+ exports.__assumedHttpMethod = "", exports.__file = "UserPasswordPut.ts", exports.__query = [], exports.__params = [];
66
+ 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": {} } };
@@ -4,3 +4,5 @@ import { UserPasswordResetCompleteReq } from "../schemas/UserPasswordResetComple
4
4
  import { UserPasswordResetCompleteRes } from "../schemas/UserPasswordResetCompleteRes";
5
5
  declare const postPasswordResetCompleteHandler: Handler<FlinkContext<genericAuthContext>, UserPasswordResetCompleteReq, UserPasswordResetCompleteRes>;
6
6
  export default postPasswordResetCompleteHandler;
7
+ export declare const __assumedHttpMethod = "", __file = "UserPasswordResetComplete.ts", __query: never[], __params: never[];
8
+ export declare const __schemas: any;
@@ -36,6 +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
40
  var flink_1 = require("@flink-app/flink");
40
41
  var postPasswordResetCompleteHandler = function (_a) {
41
42
  var ctx = _a.ctx, req = _a.req, origin = _a.origin;
@@ -67,3 +68,5 @@ var postPasswordResetCompleteHandler = function (_a) {
67
68
  });
68
69
  };
69
70
  exports.default = postPasswordResetCompleteHandler;
71
+ exports.__assumedHttpMethod = "", exports.__file = "UserPasswordResetComplete.ts", exports.__query = [], exports.__params = [];
72
+ 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": {} } };
@@ -3,3 +3,4 @@ export declare function handleUserPasswordResetForm(_req: ExpressRequest, res: E
3
3
  templateFile?: string;
4
4
  completeUrl: string;
5
5
  }): Promise<void>;
6
+ export declare const __assumedHttpMethod = "", __file = "UserPasswordResetForm.ts", __query: never[], __params: never[];
@@ -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.handleUserPasswordResetForm = void 0;
42
+ exports.__params = exports.__query = exports.__file = exports.__assumedHttpMethod = exports.handleUserPasswordResetForm = void 0;
43
43
  var promises_1 = __importDefault(require("fs/promises"));
44
44
  var flink_1 = require("@flink-app/flink");
45
45
  var handlebars_1 = __importDefault(require("handlebars"));
@@ -93,3 +93,4 @@ function readTemplate(templateFilename) {
93
93
  });
94
94
  });
95
95
  }
96
+ exports.__assumedHttpMethod = "", exports.__file = "UserPasswordResetForm.ts", exports.__query = [], exports.__params = [];
@@ -5,3 +5,5 @@ import { UserPasswordResetStartReq } from "../schemas/UserPasswordResetStartReq"
5
5
  import { UserPasswordResetStartResPublic } from "../schemas/UserPasswordResetStartResPublic";
6
6
  declare const postPasswordResetStartHandler: Handler<FlinkContext<genericAuthContext & emailPluginContext>, UserPasswordResetStartReq, UserPasswordResetStartResPublic>;
7
7
  export default postPasswordResetStartHandler;
8
+ export declare const __assumedHttpMethod = "", __file = "UserPasswordResetStart.ts", __query: never[], __params: never[];
9
+ export declare const __schemas: any;
@@ -39,38 +39,43 @@ 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
43
  var flink_1 = require("@flink-app/flink");
43
44
  var handlebars_1 = __importDefault(require("handlebars"));
44
45
  var postPasswordResetStartHandler = function (_a) {
45
46
  var ctx = _a.ctx, req = _a.req, origin = _a.origin;
46
47
  return __awaiter(void 0, void 0, void 0, function () {
47
- var pluginName, repo, _b, jwtSecret, numberOfDigits, lifeTime, resp, emailSettings, emailCtx, subject, html, email;
48
+ var pluginName, genericAuthPlugin, repo, _b, jwtSecret, numberOfDigits, lifeTime, resp, emailCtx, emailSettings, subject, html, email;
48
49
  var _c;
49
50
  return __generator(this, function (_d) {
50
51
  switch (_d.label) {
51
52
  case 0:
52
53
  pluginName = origin || "genericAuthPlugin";
53
- repo = ctx.repos[ctx.plugins[pluginName].repoName];
54
+ genericAuthPlugin = ctx.plugins[pluginName];
55
+ repo = ctx.repos[genericAuthPlugin.repoName];
54
56
  if (((_c = ctx.plugins.emailPlugin) === null || _c === void 0 ? void 0 : _c.client) == null) {
55
57
  return [2 /*return*/, flink_1.internalServerError("Email plugin have to be initialized to use /password/reset")];
56
58
  }
57
- if (ctx.plugins.genericAuthPlugin.passwordResetSettings == null) {
59
+ if (!genericAuthPlugin.passwordResetSettings) {
58
60
  return [2 /*return*/, flink_1.internalServerError("Password reset settings is needed to use /password/reset")];
59
61
  }
60
- _b = ctx.plugins[pluginName].passwordResetSettings.code, jwtSecret = _b.jwtSecret, numberOfDigits = _b.numberOfDigits, lifeTime = _b.lifeTime;
61
- return [4 /*yield*/, ctx.plugins.genericAuthPlugin.passwordResetStart(repo, ctx.auth, jwtSecret, req.body.username, numberOfDigits, lifeTime)];
62
+ _b = genericAuthPlugin.passwordResetSettings.code, jwtSecret = _b.jwtSecret, numberOfDigits = _b.numberOfDigits, lifeTime = _b.lifeTime;
63
+ return [4 /*yield*/, genericAuthPlugin.passwordResetStart(repo, ctx.auth, jwtSecret, req.body.username, numberOfDigits, lifeTime)];
62
64
  case 1:
63
65
  resp = _d.sent();
64
66
  if (resp.status != "success") {
65
- return [2 /*return*/, { data: { status: resp.status } }];
67
+ return [2 /*return*/, { data: { status: "success", passwordResetToken: resp.passwordResetToken } }];
66
68
  }
67
- emailSettings = ctx.plugins[pluginName].passwordResetSettings.email;
68
69
  emailCtx = {
69
70
  code: resp.code,
70
71
  passwordResetToken: resp.passwordResetToken,
71
72
  username: req.body.username,
72
73
  profile: resp.profile,
73
74
  };
75
+ emailSettings = genericAuthPlugin.passwordResetSettings.email;
76
+ if (typeof emailSettings == "function") {
77
+ emailSettings = emailSettings(emailCtx);
78
+ }
74
79
  subject = handlebars_1.default.compile(emailSettings.subject)(emailCtx);
75
80
  html = handlebars_1.default.compile(emailSettings.html)(emailCtx);
76
81
  email = req.body.username;
@@ -90,3 +95,5 @@ var postPasswordResetStartHandler = function (_a) {
90
95
  });
91
96
  };
92
97
  exports.default = postPasswordResetStartHandler;
98
+ exports.__assumedHttpMethod = "", exports.__file = "UserPasswordResetStart.ts", exports.__query = [], exports.__params = [];
99
+ exports.__schemas = { reqSchema: { "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "additionalProperties": false, "properties": { "username": { "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": {} } };
@@ -3,3 +3,5 @@ import { genericAuthContext } from "../genericAuthContext";
3
3
  import { UserProfile } from "../schemas/UserProfile";
4
4
  declare const getProfileHandler: Handler<FlinkContext<genericAuthContext>, UserProfile>;
5
5
  export default getProfileHandler;
6
+ export declare const __assumedHttpMethod = "", __file = "UserProfileGet.ts", __query: never[], __params: never[];
7
+ export declare const __schemas: any;
@@ -36,6 +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
40
  var flink_1 = require("@flink-app/flink");
40
41
  var getProfileHandler = function (_a) {
41
42
  var ctx = _a.ctx, req = _a.req, origin = _a.origin;
@@ -61,3 +62,5 @@ var getProfileHandler = function (_a) {
61
62
  });
62
63
  };
63
64
  exports.default = getProfileHandler;
65
+ exports.__assumedHttpMethod = "", exports.__file = "UserProfileGet.ts", exports.__query = [], exports.__params = [];
66
+ exports.__schemas = { reqSchema: { "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "properties": {}, "definitions": {} }, resSchema: undefined };
@@ -3,3 +3,5 @@ import { genericAuthContext } from "../genericAuthContext";
3
3
  import { UserProfile } from "../schemas/UserProfile";
4
4
  declare const putUserProfileHandler: Handler<FlinkContext<genericAuthContext>, UserProfile, UserProfile>;
5
5
  export default putUserProfileHandler;
6
+ export declare const __assumedHttpMethod = "", __file = "UserProfilePut.ts", __query: never[], __params: never[];
7
+ export declare const __schemas: any;
@@ -47,6 +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
51
  var flink_1 = require("@flink-app/flink");
51
52
  var putUserProfileHandler = function (_a) {
52
53
  var ctx = _a.ctx, req = _a.req, origin = _a.origin;
@@ -79,3 +80,5 @@ var putUserProfileHandler = function (_a) {
79
80
  });
80
81
  };
81
82
  exports.default = putUserProfileHandler;
83
+ exports.__assumedHttpMethod = "", exports.__file = "UserProfilePut.ts", exports.__query = [], exports.__params = [];
84
+ 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": {} } };
@@ -4,3 +4,5 @@ import { PushNotificationToken } from "../schemas/PushNotificationToken";
4
4
  import { PushNotificatioNTokenRes } from "../schemas/PushNotificationTokenRes";
5
5
  declare const postUserPushRegisterTokenHandler: Handler<FlinkContext<genericAuthContext>, PushNotificationToken, PushNotificatioNTokenRes>;
6
6
  export default postUserPushRegisterTokenHandler;
7
+ export declare const __assumedHttpMethod = "", __file = "UserPushRegisterToken.ts", __query: never[], __params: never[];
8
+ export declare const __schemas: any;
@@ -36,6 +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
40
  var flink_1 = require("@flink-app/flink");
40
41
  var postUserPushRegisterTokenHandler = function (_a) {
41
42
  var ctx = _a.ctx, req = _a.req, origin = _a.origin;
@@ -70,3 +71,5 @@ var postUserPushRegisterTokenHandler = function (_a) {
70
71
  });
71
72
  };
72
73
  exports.default = postUserPushRegisterTokenHandler;
74
+ exports.__assumedHttpMethod = "", exports.__file = "UserPushRegisterToken.ts", exports.__query = [], exports.__params = [];
75
+ exports.__schemas = { reqSchema: { "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "additionalProperties": false, "properties": { "deviceId": { "type": "string" }, "token": { "type": "string" } }, "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,3 +4,5 @@ import { PushNotificationToken } from "../schemas/PushNotificationToken";
4
4
  import { PushNotificatioNTokenRes } from "../schemas/PushNotificationTokenRes";
5
5
  declare const postUserRemoveTokenHandler: Handler<FlinkContext<genericAuthContext>, PushNotificationToken, PushNotificatioNTokenRes>;
6
6
  export default postUserRemoveTokenHandler;
7
+ export declare const __assumedHttpMethod = "", __file = "UserPushRemoveToken.ts", __query: never[], __params: never[];
8
+ export declare const __schemas: any;
@@ -36,6 +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
40
  var flink_1 = require("@flink-app/flink");
40
41
  var postUserRemoveTokenHandler = function (_a) {
41
42
  var ctx = _a.ctx, req = _a.req, origin = _a.origin;
@@ -64,3 +65,5 @@ var postUserRemoveTokenHandler = function (_a) {
64
65
  });
65
66
  };
66
67
  exports.default = postUserRemoveTokenHandler;
68
+ exports.__assumedHttpMethod = "", exports.__file = "UserPushRemoveToken.ts", exports.__query = [], exports.__params = [];
69
+ exports.__schemas = { reqSchema: { "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "additionalProperties": false, "properties": { "deviceId": { "type": "string" }, "token": { "type": "string" } }, "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": {} } };
@@ -3,3 +3,5 @@ import { genericAuthContext } from "../genericAuthContext";
3
3
  import { UserTokenRes } from "../schemas/UserTokenRes";
4
4
  declare const getUserTokenHandler: Handler<FlinkContext<genericAuthContext>, UserTokenRes>;
5
5
  export default getUserTokenHandler;
6
+ export declare const __assumedHttpMethod = "", __file = "UserToken.ts", __query: never[], __params: never[];
7
+ export declare const __schemas: any;
@@ -36,6 +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
40
  var flink_1 = require("@flink-app/flink");
40
41
  var getUserTokenHandler = function (_a) {
41
42
  var ctx = _a.ctx, req = _a.req, origin = _a.origin;
@@ -64,3 +65,5 @@ var getUserTokenHandler = function (_a) {
64
65
  });
65
66
  };
66
67
  exports.default = getUserTokenHandler;
68
+ exports.__assumedHttpMethod = "", exports.__file = "UserToken.ts", exports.__query = [], exports.__params = [];
69
+ exports.__schemas = { reqSchema: { "$schema": "http://json-schema.org/draft-07/schema#", "type": "object", "additionalProperties": false, "properties": { "token": { "type": "string" } }, "required": ["token"], "definitions": {} }, resSchema: undefined };
@@ -1,9 +1,17 @@
1
+ import { UserProfile } from "./UserProfile";
2
+ interface EmailConfig {
3
+ from_address: string;
4
+ subject: string;
5
+ html: string;
6
+ }
7
+ interface EmailCtx {
8
+ code?: string;
9
+ passwordResetToken?: string;
10
+ username: string;
11
+ profile?: UserProfile;
12
+ }
1
13
  export interface UserPasswordResetSettings {
2
- email: {
3
- from_address: string;
4
- subject: string;
5
- html: string;
6
- };
14
+ email: EmailConfig | ((emailCtx: EmailCtx) => EmailConfig);
7
15
  code: {
8
16
  numberOfDigits: number;
9
17
  lifeTime: string;
@@ -12,3 +20,4 @@ export interface UserPasswordResetSettings {
12
20
  enablePasswordResetForm?: boolean;
13
21
  passwordResetForm?: string;
14
22
  }
23
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flink-app/generic-auth-plugin",
3
- "version": "0.7.0-alpha.0",
3
+ "version": "0.11.0",
4
4
  "description": "Flink plugin that provides a generic user authentification solution.",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\"",
@@ -16,19 +16,19 @@
16
16
  "types": "dist/src/index.d.ts",
17
17
  "main": "dist/src/index.js",
18
18
  "dependencies": {
19
- "@flink-app/email-plugin": "^0.7.0-alpha.0",
20
- "@flink-app/jwt-auth-plugin": "^0.7.0-alpha.0",
21
- "@flink-app/management-api-plugin": "^0.7.0-alpha.0",
22
- "@flink-app/sms-plugin": "^0.7.0-alpha.0",
19
+ "@flink-app/email-plugin": "^0.11.0",
20
+ "@flink-app/jwt-auth-plugin": "^0.11.0",
21
+ "@flink-app/management-api-plugin": "^0.11.0",
22
+ "@flink-app/sms-plugin": "^0.11.0",
23
23
  "handlebars": "^4.7.7",
24
24
  "jsonwebtoken": "^8.5.1"
25
25
  },
26
26
  "devDependencies": {
27
- "@flink-app/flink": "^0.7.0-alpha.0",
27
+ "@flink-app/flink": "^0.11.0",
28
28
  "@types/jsonwebtoken": "^8.5.2",
29
29
  "@types/node": "^15.6.2",
30
30
  "ts-node": "^9.1.1",
31
31
  "typescript": "^4.2.4"
32
32
  },
33
- "gitHead": "1e656eeb0e76d6ad8c6cc48200161aa445e365df"
33
+ "gitHead": "3869def3e7e7e7105373ad31bc23a8ed68108015"
34
34
  }
@@ -281,12 +281,21 @@ export async function passwordResetStart(
281
281
  lifeTime?: string
282
282
  ): Promise<UserPasswordResetStartRes> {
283
283
  const user = await repo.getOne({ username: username.toLowerCase() });
284
+
285
+ const fakepayload = {
286
+ type: "passwordReset",
287
+ username: username.toLocaleLowerCase(),
288
+ };
289
+ const fakeToken = jsonwebtoken.sign(fakepayload, "fake_payload", { expiresIn: lifeTime });
290
+
291
+
292
+
284
293
  if (user == null) {
285
- return { status: "userNotFound" };
294
+ return { status: "userNotFound", passwordResetToken : fakeToken };
286
295
  }
287
296
 
288
297
  if (user.authentificationMethod != "password") {
289
- return { status: "userNotFound" };
298
+ return { status: "userNotFound", passwordResetToken : fakeToken };
290
299
  }
291
300
 
292
301
  if (numberOfDigits == null) numberOfDigits = 6;