@flink-app/generic-auth-plugin 0.12.1-alpha.26 → 0.12.1-alpha.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.flink/generatedHandlers.ts +1 -1
- package/.flink/generatedJobs.ts +1 -1
- package/.flink/generatedRepos.ts +1 -1
- package/.flink/schemas/schemas.ts +1 -1
- package/.flink/start.ts +1 -1
- package/dist/.flink/generatedHandlers.js +1 -1
- package/dist/.flink/generatedJobs.js +1 -1
- package/dist/.flink/generatedRepos.js +1 -1
- package/dist/.flink/start.js +1 -1
- package/dist/src/coreFunctions.js +7 -1
- package/package.json +2 -2
- package/src/coreFunctions.ts +8 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Generated Thu Sep 11 2025
|
|
1
|
+
// Generated Thu Sep 11 2025 10:23:23 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";
|
package/.flink/generatedJobs.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Generated Thu Sep 11 2025
|
|
1
|
+
// Generated Thu Sep 11 2025 10:23:24 GMT+0200 (Central European Summer Time)
|
|
2
2
|
import { autoRegisteredJobs } from "@flink-app/flink";
|
|
3
3
|
export const jobs = [];
|
|
4
4
|
autoRegisteredJobs.push(...jobs);
|
package/.flink/generatedRepos.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Generated Thu Sep 11 2025
|
|
1
|
+
// Generated Thu Sep 11 2025 10:23:23 GMT+0200 (Central European Summer Time)
|
|
2
2
|
import { autoRegisteredRepos } from "@flink-app/flink";
|
|
3
3
|
export const repos = [];
|
|
4
4
|
autoRegisteredRepos.push(...repos);
|
|
@@ -29,7 +29,7 @@ import { PutManagementUserRolesByUseridRes } from "../../src/schemas/Management/
|
|
|
29
29
|
import { PutManagementUserUsernameByUseridReq } from "../../src/schemas/Management/PutUserUsernameByUseridReq";
|
|
30
30
|
import { PutManagementUserUsernameByUseridRes } from "../../src/schemas/Management/PutUserUsernameByUseridRes";
|
|
31
31
|
|
|
32
|
-
// Generated Thu Sep 11 2025
|
|
32
|
+
// Generated Thu Sep 11 2025 10:23:24 GMT+0200 (Central European Summer Time)
|
|
33
33
|
export interface UserCreate_7_ReqSchema extends UserCreateReq {}
|
|
34
34
|
|
|
35
35
|
export interface UserCreate_7_ResSchema extends UserCreateRes {}
|
package/.flink/start.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.handlers = void 0;
|
|
4
|
-
// Generated Thu Sep 11 2025
|
|
4
|
+
// Generated Thu Sep 11 2025 10:23:23 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.jobs = void 0;
|
|
4
|
-
// Generated Thu Sep 11 2025
|
|
4
|
+
// Generated Thu Sep 11 2025 10:23:24 GMT+0200 (Central European Summer Time)
|
|
5
5
|
var flink_1 = require("@flink-app/flink");
|
|
6
6
|
exports.jobs = [];
|
|
7
7
|
flink_1.autoRegisteredJobs.push.apply(flink_1.autoRegisteredJobs, exports.jobs);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.repos = void 0;
|
|
4
|
-
// Generated Thu Sep 11 2025
|
|
4
|
+
// Generated Thu Sep 11 2025 10:23:23 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);
|
package/dist/.flink/start.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
// Generated Thu Sep 11 2025
|
|
3
|
+
// Generated Thu Sep 11 2025 10:23:24 GMT+0200 (Central European Summer Time)
|
|
4
4
|
require("./generatedHandlers");
|
|
5
5
|
require("./generatedRepos");
|
|
6
6
|
require("./generatedJobs");
|
|
@@ -97,6 +97,12 @@ function createUser(repo, auth, username, password, authentificationMethod, role
|
|
|
97
97
|
if (personalNumber) {
|
|
98
98
|
userData.personalNumber = personalNumber;
|
|
99
99
|
}
|
|
100
|
+
if (authentificationMethod == "bankid") {
|
|
101
|
+
if (!personalNumber) {
|
|
102
|
+
flink_1.log.warn("BankID login requested but no personal number found for user");
|
|
103
|
+
return [2 /*return*/, { status: "error" }];
|
|
104
|
+
}
|
|
105
|
+
}
|
|
100
106
|
if (!(authentificationMethod == "password")) return [3 /*break*/, 6];
|
|
101
107
|
passwordAndSalt = null;
|
|
102
108
|
if (!(createPasswordHashAndSaltMethod != null)) return [3 /*break*/, 3];
|
|
@@ -128,7 +134,7 @@ function createUser(repo, auth, username, password, authentificationMethod, role
|
|
|
128
134
|
case 9: return [4 /*yield*/, auth.createToken({ username: username.toLowerCase(), _id: user._id }, roles)];
|
|
129
135
|
case 10:
|
|
130
136
|
token = _a.sent();
|
|
131
|
-
if (user.authentificationMethod == "sms"
|
|
137
|
+
if (user.authentificationMethod == "sms") {
|
|
132
138
|
return [2 /*return*/, {
|
|
133
139
|
status: "success",
|
|
134
140
|
}];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@flink-app/generic-auth-plugin",
|
|
3
|
-
"version": "0.12.1-alpha.
|
|
3
|
+
"version": "0.12.1-alpha.27",
|
|
4
4
|
"description": "Flink plugin that provides a generic user authentification solution.",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"test": "echo \"Error: no test specified\"",
|
|
@@ -30,5 +30,5 @@
|
|
|
30
30
|
"ts-node": "^9.1.1",
|
|
31
31
|
"typescript": "5.4.5"
|
|
32
32
|
},
|
|
33
|
-
"gitHead": "
|
|
33
|
+
"gitHead": "6714d51c8e343b0bdfa82d34dbc205f112f9e3b9"
|
|
34
34
|
}
|
package/src/coreFunctions.ts
CHANGED
|
@@ -76,6 +76,13 @@ export async function createUser(
|
|
|
76
76
|
userData.personalNumber = personalNumber;
|
|
77
77
|
}
|
|
78
78
|
|
|
79
|
+
if (authentificationMethod == "bankid") {
|
|
80
|
+
if (!personalNumber) {
|
|
81
|
+
log.warn("BankID login requested but no personal number found for user");
|
|
82
|
+
return { status: "error" };
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
79
86
|
if (authentificationMethod == "password") {
|
|
80
87
|
let passwordAndSalt = null;
|
|
81
88
|
if (createPasswordHashAndSaltMethod != null) {
|
|
@@ -101,7 +108,7 @@ export async function createUser(
|
|
|
101
108
|
|
|
102
109
|
const token = await auth.createToken({ username: username.toLowerCase(), _id: user._id }, roles);
|
|
103
110
|
|
|
104
|
-
if (user.authentificationMethod == "sms"
|
|
111
|
+
if (user.authentificationMethod == "sms") {
|
|
105
112
|
return {
|
|
106
113
|
status: "success",
|
|
107
114
|
};
|