Skip to content

Commit ccbe281

Browse files
Merge pull request #1566 from solid/disable-linked-users
Disable linked users in IDP
2 parents 430abd1 + b6754e0 commit ccbe281

File tree

3 files changed

+9
-19
lines changed

3 files changed

+9
-19
lines changed

default-views/account/register-form.hbs

-15
Original file line numberDiff line numberDiff line change
@@ -63,21 +63,6 @@
6363
<span class="help-block">Your email will only be used for account recovery</span>
6464
</div>
6565

66-
<div class="checkbox">
67-
<label>
68-
<input type="checkbox" name="connectExternalWebId" value="true" id="ConnectExternalWebId" {{#if connectExternalWebId}}checked{{/if}}/>
69-
Connect to External WebID (<strong>Advanced feature</strong>)
70-
</label>
71-
</div>
72-
73-
<div class="form-group hidden" id="ExternalWebId">
74-
<label class="control-label" for="externalWebId">External WebID:</label>
75-
<input type="text" class="form-control" name="externalWebId" id="externalWebId" value="{{externalWebId}}"/>
76-
<span class="help-block">
77-
By connecting this account with an existing WebID, you can use that WebID to authenticate with the new account.
78-
</span>
79-
</div>
80-
8166
{{#if enforceToc}}
8267
{{#if tocUri}}
8368
<div class="checkbox">

lib/models/authenticator.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,9 @@ class PasswordAuthenticator extends Authenticator {
144144
error.statusCode = 400
145145
throw error
146146
}
147-
147+
if (foundUser.link) {
148+
throw new Error('Linked users not currently supported, sorry (external WebID without TLS?)')
149+
}
148150
return this.userStore.matchPassword(foundUser, this.password)
149151
})
150152
.then(validUser => {

lib/requests/create-account-request.js

+6-3
Original file line numberDiff line numberDiff line change
@@ -120,9 +120,7 @@ class CreateAccountRequest extends AuthRequest {
120120
username: data.username,
121121
name: data.name,
122122
email: data.email,
123-
externalWebId: data.externalWebId,
124-
acceptToc: data.acceptToc,
125-
connectExternalWebId: data.connectExternalWebId
123+
acceptToc: data.acceptToc
126124
})
127125

128126
if (error) {
@@ -144,6 +142,11 @@ class CreateAccountRequest extends AuthRequest {
144142
const userAccount = this.userAccount
145143
const accountManager = this.accountManager
146144

145+
if (userAccount.externalWebId) {
146+
const error = new Error('Linked users not currently supported, sorry (external WebID without TLS?)')
147+
error.statusCode = 400
148+
throw error
149+
}
147150
this.cancelIfUsernameInvalid(userAccount)
148151
this.cancelIfBlacklistedUsername(userAccount)
149152
await this.cancelIfAccountExists(userAccount)

0 commit comments

Comments
 (0)