Skip to content

Commit 89e631b

Browse files
author
deiu
committed
Use options.overwrite instead of vhosts
1 parent 474d094 commit 89e631b

2 files changed

Lines changed: 5 additions & 12 deletions

File tree

‎lib/create-app.js‎

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,10 @@ 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-
}
5955
var idp = IdentityProvider({
6056
store: ldp,
61-
vhosts: useVhosts,
62-
suffixAcl: ldp.suffixAcl
57+
suffixAcl: ldp.suffixAcl,
58+
overwrite: ldp.signup
6359
})
6460
app.use('/accounts', idp.middleware(corsSettings));
6561
app.use('/', corsSettings, idp.get.bind(idp))

‎lib/identity-provider.js‎

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +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
38+
this.overwrite = options.overwrite
3939
}
4040

4141
// Generate the future webid from the options and the IdentityProvider Settings
@@ -76,13 +76,10 @@ IdentityProvider.prototype.create = function (options, cert, callback) {
7676
// TODO create workspaces
7777
// remove port from host
7878

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

0 commit comments

Comments
 (0)