@friggframework/core 2.0.0-next.119 → 2.0.0-next.120
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/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@friggframework/core",
|
|
3
3
|
"prettier": "@friggframework/prettier-config",
|
|
4
|
-
"version": "2.0.0-next.
|
|
4
|
+
"version": "2.0.0-next.120",
|
|
5
5
|
"dependencies": {
|
|
6
6
|
"@aws-sdk/client-apigatewaymanagementapi": "^3.588.0",
|
|
7
7
|
"@aws-sdk/client-kms": "^3.588.0",
|
|
@@ -47,9 +47,9 @@
|
|
|
47
47
|
}
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
|
-
"@friggframework/eslint-config": "2.0.0-next.
|
|
51
|
-
"@friggframework/prettier-config": "2.0.0-next.
|
|
52
|
-
"@friggframework/test": "2.0.0-next.
|
|
50
|
+
"@friggframework/eslint-config": "2.0.0-next.120",
|
|
51
|
+
"@friggframework/prettier-config": "2.0.0-next.120",
|
|
52
|
+
"@friggframework/test": "2.0.0-next.120",
|
|
53
53
|
"@prisma/client": "^6.19.3",
|
|
54
54
|
"@types/lodash": "4.17.15",
|
|
55
55
|
"@typescript-eslint/eslint-plugin": "^8.0.0",
|
|
@@ -89,5 +89,5 @@
|
|
|
89
89
|
"publishConfig": {
|
|
90
90
|
"access": "public"
|
|
91
91
|
},
|
|
92
|
-
"gitHead": "
|
|
92
|
+
"gitHead": "e13f909d7386abdcac04f4adc875f8f1e0544b88"
|
|
93
93
|
}
|
|
@@ -23,7 +23,7 @@ class TestUserRepository {
|
|
|
23
23
|
|
|
24
24
|
async createToken(userId, rawToken, minutes = 120) {
|
|
25
25
|
const token = `token-for-${userId}-for-${minutes}-mins`;
|
|
26
|
-
this.tokens.set(token, {
|
|
26
|
+
this.tokens.set(token, { id: token, userId, rawToken });
|
|
27
27
|
return token;
|
|
28
28
|
}
|
|
29
29
|
|
|
@@ -40,8 +40,13 @@ class GetUserFromBearerToken {
|
|
|
40
40
|
throw Boom.unauthorized('Session Token Not Found');
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
+
const tokenUserId = sessionToken.userId;
|
|
44
|
+
if (!tokenUserId) {
|
|
45
|
+
throw Boom.unauthorized('Session Token Has No User');
|
|
46
|
+
}
|
|
47
|
+
|
|
43
48
|
if (this.userConfig.primary === 'organization') {
|
|
44
|
-
const organizationUserData = await this.userRepository.findOrganizationUserById(
|
|
49
|
+
const organizationUserData = await this.userRepository.findOrganizationUserById(tokenUserId);
|
|
45
50
|
|
|
46
51
|
if (!organizationUserData) {
|
|
47
52
|
throw Boom.unauthorized('Organization User Not Found');
|
|
@@ -57,7 +62,7 @@ class GetUserFromBearerToken {
|
|
|
57
62
|
);
|
|
58
63
|
}
|
|
59
64
|
|
|
60
|
-
const individualUserData = await this.userRepository.findIndividualUserById(
|
|
65
|
+
const individualUserData = await this.userRepository.findIndividualUserById(tokenUserId);
|
|
61
66
|
|
|
62
67
|
if (!individualUserData) {
|
|
63
68
|
throw Boom.unauthorized('Individual User Not Found');
|