@flink-app/generic-auth-plugin 0.4.9 → 0.5.1

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.
@@ -1,4 +1,4 @@
1
- // Generated Wed Mar 08 2023 10:49:18 GMT+0100 (Central European Standard Time)
1
+ // Generated Thu Mar 30 2023 10:55:11 GMT+0200 (Central European Summer Time)
2
2
  import { autoRegisteredHandlers, HttpMethod } from "@flink-app/flink";
3
3
  import * as UserCreate_0 from "../src/handlers/UserCreate";
4
4
  import * as UserLogin_0 from "../src/handlers/UserLogin";
@@ -1,4 +1,4 @@
1
- // Generated Wed Mar 08 2023 10:49:18 GMT+0100 (Central European Standard Time)
1
+ // Generated Thu Mar 30 2023 10:55:11 GMT+0200 (Central European Summer Time)
2
2
  import { autoRegisteredRepos } from "@flink-app/flink";
3
3
  export const repos = [];
4
4
  autoRegisteredRepos.push(...repos);
@@ -30,7 +30,7 @@ import { PutManagementUserRolesByUseridRes } from "../../src/schemas/Management/
30
30
  import { PutManagementUserUsernameByUseridReq } from "../../src/schemas/Management/PutUserUsernameByUseridReq";
31
31
  import { PutManagementUserUsernameByUseridRes } from "../../src/schemas/Management/PutUserUsernameByUseridRes";
32
32
 
33
- // Generated Wed Mar 08 2023 10:49:20 GMT+0100 (Central European Standard Time)
33
+ // Generated Thu Mar 30 2023 10:55:13 GMT+0200 (Central European Summer Time)
34
34
  export interface UserCreate_7_ReqSchema extends UserCreateReq {}
35
35
 
36
36
  export interface UserCreate_7_ResSchema extends UserCreateRes {}
package/.flink/start.ts CHANGED
@@ -1,4 +1,4 @@
1
- // Generated Wed Mar 08 2023 10:49:19 GMT+0100 (Central European Standard Time)
1
+ // Generated Thu Mar 30 2023 10:55:11 GMT+0200 (Central European Summer Time)
2
2
  import "./generatedHandlers";
3
3
  import "./generatedRepos";
4
4
  import "../src/index";
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.handlers = void 0;
4
- // Generated Wed Mar 08 2023 10:49:18 GMT+0100 (Central European Standard Time)
4
+ // Generated Thu Mar 30 2023 10:55:11 GMT+0200 (Central European Summer Time)
5
5
  var flink_1 = require("@flink-app/flink");
6
6
  exports.handlers = [];
7
7
  flink_1.autoRegisteredHandlers.push.apply(flink_1.autoRegisteredHandlers, exports.handlers);
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.repos = void 0;
4
- // Generated Wed Mar 08 2023 10:49:18 GMT+0100 (Central European Standard Time)
4
+ // Generated Thu Mar 30 2023 10:55:11 GMT+0200 (Central European Summer Time)
5
5
  var flink_1 = require("@flink-app/flink");
6
6
  exports.repos = [];
7
7
  flink_1.autoRegisteredRepos.push.apply(flink_1.autoRegisteredRepos, exports.repos);
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- // Generated Wed Mar 08 2023 10:49:19 GMT+0100 (Central European Standard Time)
3
+ // Generated Thu Mar 30 2023 10:55:11 GMT+0200 (Central European Summer Time)
4
4
  require("./generatedHandlers");
5
5
  require("./generatedRepos");
6
6
  require("../src/index");
@@ -9,6 +9,7 @@ export interface GenericAuthPluginOptions {
9
9
  enableUserCreation?: boolean;
10
10
  enableProfileUpdate?: boolean;
11
11
  enablePasswordUpdate?: boolean;
12
+ enableUserLogin?: boolean;
12
13
  baseUrl?: string;
13
14
  pluginId?: string;
14
15
  createPasswordHashAndSaltMethod?: {
package/dist/src/init.js CHANGED
@@ -41,15 +41,19 @@ function init(app, options) {
41
41
  options.enableProfileUpdate = true;
42
42
  if (options.enablePasswordUpdate == null)
43
43
  options.enablePasswordUpdate = true;
44
+ if (options.enableUserLogin == null)
45
+ options.enableUserLogin = true;
44
46
  if (options.baseUrl == null)
45
47
  options.baseUrl = "/user";
46
48
  if (options.enableRoutes) {
47
- app.addHandler(userLoginHandler, {
48
- method: flink_1.HttpMethod.post,
49
- path: options.baseUrl + "/login",
50
- docs: "Authenticates a user",
51
- origin: options.pluginId,
52
- });
49
+ if (options.enableUserLogin) {
50
+ app.addHandler(userLoginHandler, {
51
+ method: flink_1.HttpMethod.post,
52
+ path: options.baseUrl + "/login",
53
+ docs: "Authenticates a user",
54
+ origin: options.pluginId,
55
+ });
56
+ }
53
57
  if (options.sms) {
54
58
  app.addHandler(userLoginByTokenHandler, {
55
59
  method: flink_1.HttpMethod.post,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flink-app/generic-auth-plugin",
3
- "version": "0.4.9",
3
+ "version": "0.5.1",
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.4.7",
20
- "@flink-app/jwt-auth-plugin": "^0.4.7",
21
- "@flink-app/management-api-plugin": "^0.4.7",
22
- "@flink-app/sms-plugin": "^0.4.7",
19
+ "@flink-app/email-plugin": "^0.5.0",
20
+ "@flink-app/jwt-auth-plugin": "^0.5.0",
21
+ "@flink-app/management-api-plugin": "^0.5.0",
22
+ "@flink-app/sms-plugin": "^0.5.0",
23
23
  "handlebars": "^4.7.7",
24
24
  "jsonwebtoken": "^8.5.1"
25
25
  },
26
26
  "devDependencies": {
27
- "@flink-app/flink": "^0.4.7",
27
+ "@flink-app/flink": "^0.5.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": "0950911c86dfd1d77157c50f79e3d6529f1aae67"
33
+ "gitHead": "2f2181e811498a62cdffd75bddd5a084db3c28dc"
34
34
  }
@@ -9,6 +9,7 @@ export interface GenericAuthPluginOptions {
9
9
  enableUserCreation?: boolean;
10
10
  enableProfileUpdate?: boolean;
11
11
  enablePasswordUpdate?: boolean;
12
+ enableUserLogin?: boolean;
12
13
  baseUrl?: string;
13
14
  pluginId?: string;
14
15
  createPasswordHashAndSaltMethod?: {
package/src/init.ts CHANGED
@@ -17,15 +17,19 @@ export function init(app: FlinkApp<any>, options: GenericAuthPluginOptions) {
17
17
  if (options.enableUserCreation == null) options.enableUserCreation = true;
18
18
  if (options.enableProfileUpdate == null) options.enableProfileUpdate = true;
19
19
  if (options.enablePasswordUpdate == null) options.enablePasswordUpdate = true;
20
+ if (options.enableUserLogin == null) options.enableUserLogin = true;
21
+
20
22
  if (options.baseUrl == null) options.baseUrl = "/user";
21
23
 
22
24
  if (options.enableRoutes) {
23
- app.addHandler(userLoginHandler, {
24
- method: HttpMethod.post,
25
- path: options.baseUrl + "/login",
26
- docs: "Authenticates a user",
27
- origin: options.pluginId,
28
- });
25
+ if(options.enableUserLogin){
26
+ app.addHandler(userLoginHandler, {
27
+ method: HttpMethod.post,
28
+ path: options.baseUrl + "/login",
29
+ docs: "Authenticates a user",
30
+ origin: options.pluginId,
31
+ });
32
+ }
29
33
  if(options.sms){
30
34
  app.addHandler(userLoginByTokenHandler, {
31
35
  method: HttpMethod.post,