solid-server 5.8.1 → 5.8.2
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.
|
@@ -57,7 +57,7 @@ class AccountManager {
|
|
|
57
57
|
*
|
|
58
58
|
* ```
|
|
59
59
|
* let options = { host, multiuser, store }
|
|
60
|
-
* let
|
|
60
|
+
* let accountManager = AccountManager.from(options)
|
|
61
61
|
* ```
|
|
62
62
|
*
|
|
63
63
|
* @param [options={}] {Object} See the `constructor()` docstring.
|
|
@@ -6,6 +6,7 @@ const recursiveRead = require('recursive-readdir')
|
|
|
6
6
|
const fsUtils = require('../common/fs-utils')
|
|
7
7
|
const templateUtils = require('../common/template-utils')
|
|
8
8
|
const LDP = require('../ldp')
|
|
9
|
+
const { URL } = require('url')
|
|
9
10
|
|
|
10
11
|
const TEMPLATE_EXTENSIONS = ['.acl', '.meta', '.json', '.hbs', '.handlebars']
|
|
11
12
|
const TEMPLATE_FILES = ['card']
|
|
@@ -72,9 +73,11 @@ class AccountTemplate {
|
|
|
72
73
|
* @return {Object}
|
|
73
74
|
*/
|
|
74
75
|
static templateSubstitutionsFor (userAccount) {
|
|
76
|
+
const webUri = new URL(userAccount.webId)
|
|
77
|
+
const podRelWebId = userAccount.webId.replace(webUri.origin, '')
|
|
75
78
|
const substitutions = {
|
|
76
79
|
name: userAccount.displayName,
|
|
77
|
-
webId: userAccount.webId,
|
|
80
|
+
webId: userAccount.externalWebId ? userAccount.webId : podRelWebId,
|
|
78
81
|
email: userAccount.email,
|
|
79
82
|
idp: userAccount.idp
|
|
80
83
|
}
|