File tree Expand file tree Collapse file tree 2 files changed +16
-0
lines changed
Expand file tree Collapse file tree 2 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ const corsProxy = require('./handlers/cors-proxy')
1111const authProxy = require ( './handlers/auth-proxy' )
1212const SolidHost = require ( './models/solid-host' )
1313const AccountManager = require ( './models/account-manager' )
14+ const AccountTemplate = require ( './models/account-template' )
1415const vhost = require ( 'vhost' )
1516const EmailService = require ( './services/email-service' )
1617const TokenService = require ( './services/token-service' )
@@ -52,6 +53,8 @@ function createApp (argv = {}) {
5253 defaultContentType : argv . defaultContentType
5354 } )
5455
56+ AccountTemplate . registerHostname ( argv . serverUri )
57+
5558 const configPath = config . initConfigDir ( argv )
5659 argv . templates = config . initTemplateDirs ( configPath )
5760
Original file line number Diff line number Diff line change @@ -35,6 +35,19 @@ class AccountTemplate {
3535 this . templateFiles = options . templateFiles || TEMPLATE_FILES
3636 }
3737
38+ /**
39+ * Registers the server hostname at compile time to check for webID stuff.
40+ * @param {string } hostname
41+ * @throws if hostname already registered
42+ */
43+ static registerHostname ( hostname ) {
44+ if ( this . hostname ) {
45+ throw new Error ( 'hostname already registered' )
46+ } else {
47+ this . hostname = hostname
48+ }
49+ }
50+
3851 /**
3952 * Factory method, returns an AccountTemplate for a given user account.
4053 *
You can’t perform that action at this time.
0 commit comments