diff --git a/lib/create-app.js b/lib/create-app.js index 17e3b0fe..0cc00b6b 100644 --- a/lib/create-app.js +++ b/lib/create-app.js @@ -11,7 +11,6 @@ const corsProxy = require('./handlers/cors-proxy') const authProxy = require('./handlers/auth-proxy') const SolidHost = require('./models/solid-host') const AccountManager = require('./models/account-manager') -const AccountTemplate = require('./models/account-template') const vhost = require('vhost') const EmailService = require('./services/email-service') const TokenService = require('./services/token-service') @@ -53,8 +52,6 @@ function createApp (argv = {}) { defaultContentType: argv.defaultContentType }) - AccountTemplate.registerHostname(argv.serverUri) - const configPath = config.initConfigDir(argv) argv.templates = config.initTemplateDirs(configPath) diff --git a/lib/models/account-template.js b/lib/models/account-template.js index 227832e2..03390683 100644 --- a/lib/models/account-template.js +++ b/lib/models/account-template.js @@ -35,15 +35,6 @@ class AccountTemplate { this.templateFiles = options.templateFiles || TEMPLATE_FILES } - /** - * Registers the server hostname at compile time to check for webID stuff. - * @param {string} hostname - * @throws if hostname already registered - */ - static registerHostname (hostname) { - this.hostname = hostname - } - /** * Factory method, returns an AccountTemplate for a given user account. * @@ -81,17 +72,9 @@ class AccountTemplate { * @return {Object} */ static templateSubstitutionsFor (userAccount) { - let podRelativeWebId - // this means the user's webId and server Uri are the same - // therefore, we use a relative uri ref - if (userAccount.webId.indexOf(this.hostname) > -1) { - podRelativeWebId = path.join('/', userAccount.webId.substring(userAccount.webId.indexOf(this.hostname) + this.hostname.length)) - } else { - podRelativeWebId = userAccount.webId - } const substitutions = { name: userAccount.displayName, - webId: podRelativeWebId, + webId: userAccount.externalWebId ? userAccount.webId : '/profile/card#me', email: userAccount.email, idp: userAccount.idp }