@semapps/auth 0.9.1 → 0.9.3
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/mixins/auth.js +3 -1
- package/package.json +6 -6
- package/services/account.js +1 -3
package/mixins/auth.js
CHANGED
@@ -162,8 +162,10 @@ const AuthMixin = {
|
|
162
162
|
const baseUrlTrailing = urlJoin(this.settings.baseUrl, '/');
|
163
163
|
webId = webId || baseUrlTrailing + username;
|
164
164
|
|
165
|
+
const podUrl = await ctx.call('pod.getUrl', { webId });
|
166
|
+
|
165
167
|
// Check if capabilityUri is within the resource owner's pod
|
166
|
-
if (!webId?.startsWith(baseUrlTrailing) || !capabilityUri?.startsWith(
|
168
|
+
if (!webId?.startsWith(baseUrlTrailing) || !capabilityUri?.startsWith(podUrl)) {
|
167
169
|
return undefined;
|
168
170
|
}
|
169
171
|
|
package/package.json
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
{
|
2
2
|
"name": "@semapps/auth",
|
3
|
-
"version": "0.9.
|
3
|
+
"version": "0.9.3",
|
4
4
|
"description": "Authentification module for SemApps",
|
5
5
|
"license": "Apache-2.0",
|
6
6
|
"author": "Virtual Assembly",
|
7
7
|
"dependencies": {
|
8
|
-
"@semapps/ldp": "0.9.
|
9
|
-
"@semapps/middlewares": "0.9.
|
10
|
-
"@semapps/mime-types": "0.9.
|
11
|
-
"@semapps/triplestore": "0.9.
|
8
|
+
"@semapps/ldp": "0.9.3",
|
9
|
+
"@semapps/middlewares": "0.9.3",
|
10
|
+
"@semapps/mime-types": "0.9.3",
|
11
|
+
"@semapps/triplestore": "0.9.3",
|
12
12
|
"bcrypt": "^5.0.1",
|
13
13
|
"express-session": "^1.17.0",
|
14
14
|
"jsonwebtoken": "^8.5.1",
|
@@ -29,5 +29,5 @@
|
|
29
29
|
"engines": {
|
30
30
|
"node": ">=14"
|
31
31
|
},
|
32
|
-
"gitHead": "
|
32
|
+
"gitHead": "5c2f6a4d17379b25af3c2361e832ed10373841c3"
|
33
33
|
}
|
package/services/account.js
CHANGED
@@ -149,8 +149,7 @@ module.exports = {
|
|
149
149
|
async findDatasetByWebId(ctx) {
|
150
150
|
const webId = ctx.params.webId || ctx.meta.webId;
|
151
151
|
const account = await ctx.call('auth.account.findByWebId', { webId });
|
152
|
-
|
153
|
-
return account?.podUri ? getSlugFromUri(webId) : undefined;
|
152
|
+
return account?.username;
|
154
153
|
},
|
155
154
|
async findSettingsByWebId(ctx) {
|
156
155
|
const webId = ctx.params.webId || ctx.meta.webId;
|
@@ -214,7 +213,6 @@ module.exports = {
|
|
214
213
|
// ...except for
|
215
214
|
webId: account.webId,
|
216
215
|
username: account.username,
|
217
|
-
podUri: account.podUri,
|
218
216
|
// And add a deletedAt date.
|
219
217
|
deletedAt: new Date().toISOString()
|
220
218
|
});
|