diff --git a/default-views/account/register-form.hbs b/default-views/account/register-form.hbs index dbbfd117b..12166f888 100644 --- a/default-views/account/register-form.hbs +++ b/default-views/account/register-form.hbs @@ -9,7 +9,30 @@ - + + {{#if multiuser}} +

Your username should be a lower-case word with only + letters a-z and numbers 0-9 and without periods.

+

Your public Solid POD URL will be: + https://alice.

+

Your public Solid WebID will be: + https://alice./profile/card#me

+ +

Your POD URL is like the homepage for your Solid + pod. By default, it is readable by the public, but you can + always change that if you like by changing the access + control.

+ +

Your Solid WebID is your globally unique name + that you can use to identify and authenticate yourself with + other PODs across the world.

+ {{/if}} + +
@@ -76,3 +99,14 @@ + + + diff --git a/lib/models/account-manager.js b/lib/models/account-manager.js index 6793bdd58..05141eee7 100644 --- a/lib/models/account-manager.js +++ b/lib/models/account-manager.js @@ -350,6 +350,10 @@ class AccountManager { webId: userData.webid || userData.webId || userData.externalWebId } + if (userConfig.username) { + userConfig.username = userConfig.username.toLowerCase() + } + try { userConfig.webId = userConfig.webId || this.accountWebIdFor(userConfig.username) } catch (err) { diff --git a/lib/requests/create-account-request.js b/lib/requests/create-account-request.js index 7c5133fc6..68997822c 100644 --- a/lib/requests/create-account-request.js +++ b/lib/requests/create-account-request.js @@ -56,9 +56,8 @@ class CreateAccountRequest extends AuthRequest { let body = req.body || {} - options.username = body.username - - if (options.username) { + if (body.username) { + options.username = body.username.toLowerCase() options.userAccount = accountManager.userAccountFrom(body) } @@ -101,7 +100,8 @@ class CreateAccountRequest extends AuthRequest { { returnToUrl: this.returnToUrl, loginUrl: this.loginUrl(), - registerDisabled: authMethod === 'tls' + registerDisabled: authMethod === 'tls', + multiuser: this.accountManager.multiuser }) if (error) { @@ -200,6 +200,7 @@ class CreateAccountRequest extends AuthRequest { */ cancelIfUsernameInvalid (userAccount) { if (!userAccount.username || !/^[a-z0-9]+(?:-[a-z0-9]+)*$/.test(userAccount.username)) { + debug('Invalid username ' + userAccount.username) const error = new Error('Invalid username') error.status = 400 throw error