diff --git a/lib/models/account-template.js b/lib/models/account-template.js index 04dd8809..227832e2 100644 --- a/lib/models/account-template.js +++ b/lib/models/account-template.js @@ -41,11 +41,7 @@ class AccountTemplate { * @throws if hostname already registered */ static registerHostname (hostname) { - // if (this.hostname) { - // throw new Error('hostname already registered') - // } else { this.hostname = hostname - // } } /** @@ -85,17 +81,17 @@ class AccountTemplate { * @return {Object} */ static templateSubstitutionsFor (userAccount) { - let realWebId + let podRelativeWebId // this means the user's webId and server Uri are the same - // therefore, we use a relative address + // therefore, we use a relative uri ref if (userAccount.webId.indexOf(this.hostname) > -1) { - realWebId = path.join('/', userAccount.webId.substring(userAccount.webId.indexOf(this.hostname) + this.hostname.length)) + podRelativeWebId = path.join('/', userAccount.webId.substring(userAccount.webId.indexOf(this.hostname) + this.hostname.length)) } else { - realWebId = userAccount.webId + podRelativeWebId = userAccount.webId } const substitutions = { name: userAccount.displayName, - webId: realWebId, // userAccount.webId, + webId: podRelativeWebId, email: userAccount.email, idp: userAccount.idp }