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')
11
11
const authProxy = require ( './handlers/auth-proxy' )
12
12
const SolidHost = require ( './models/solid-host' )
13
13
const AccountManager = require ( './models/account-manager' )
14
+ const AccountTemplate = require ( './models/account-template' )
14
15
const vhost = require ( 'vhost' )
15
16
const EmailService = require ( './services/email-service' )
16
17
const TokenService = require ( './services/token-service' )
@@ -52,6 +53,8 @@ function createApp (argv = {}) {
52
53
defaultContentType : argv . defaultContentType
53
54
} )
54
55
56
+ AccountTemplate . registerHostname ( argv . serverUri )
57
+
55
58
const configPath = config . initConfigDir ( argv )
56
59
argv . templates = config . initTemplateDirs ( configPath )
57
60
Original file line number Diff line number Diff line change @@ -35,6 +35,19 @@ class AccountTemplate {
35
35
this . templateFiles = options . templateFiles || TEMPLATE_FILES
36
36
}
37
37
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
+
38
51
/**
39
52
* Factory method, returns an AccountTemplate for a given user account.
40
53
*
You can’t perform that action at this time.
0 commit comments