Skip to content

Commit 474d094

Browse files
author
deiu
committed
Allow creation of accounts on single user run mode
1 parent 8f6eba0 commit 474d094

2 files changed

Lines changed: 11 additions & 2 deletions

File tree

‎lib/create-app.js‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,13 @@ function createApp (argv) {
5252

5353
// Adding Multi-user support
5454
if (ldp.idp || ldp.signup) {
55+
var useVhosts = true;
56+
if (ldp.signup) {
57+
useVhosts = false;
58+
}
5559
var idp = IdentityProvider({
5660
store: ldp,
61+
vhosts: useVhosts,
5762
suffixAcl: ldp.suffixAcl
5863
})
5964
app.use('/accounts', idp.middleware(corsSettings));

‎lib/identity-provider.js‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ function IdentityProvider (options) {
3535
this.suffixURI = options.suffixURI || '#me'
3636
this.buildURI = options.buildURI || defaultBuildURI
3737
this.suffixAcl = options.suffixAcl
38+
this.vhosts = options.vhosts
3839
}
3940

4041
// Generate the future webid from the options and the IdentityProvider Settings
@@ -75,10 +76,13 @@ IdentityProvider.prototype.create = function (options, cert, callback) {
7576
// TODO create workspaces
7677
// remove port from host
7778

78-
var subdomain = options.host.split(':')[0]
79+
var subdomain = options.host
80+
if (self.vhosts) {
81+
subdomain = options.host.split(':')[0]
82+
}
7983
self.store.exists(subdomain, '/', function (err) {
8084
// if page exists
81-
if (!err || err.status !== 404) {
85+
if (self.vhosts && (!err || err.status !== 404)) {
8286
debug('Cannot create ' + subdomain + ', it already exists')
8387
var error = new Error('Account already exists')
8488
error.status = 406

0 commit comments

Comments
 (0)