Skip to content

Commit 9a3022a

Browse files
Expand error message for unverified web id
1 parent 34ca3a6 commit 9a3022a

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

lib/api/authn/webid-oidc.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
const express = require('express')
77
const bodyParser = require('body-parser').urlencoded({ extended: false })
88
const OidcManager = require('../../models/oidc-manager')
9-
109
const { LoginRequest } = require('../../requests/login-request')
1110

1211
const PasswordResetEmailRequest = require('../../requests/password-reset-email-request')
@@ -48,7 +47,13 @@ function initialize (app, argv) {
4847

4948
next()
5049
})
51-
.catch(next)
50+
.catch(err => {
51+
let error = new Error('Could not verify Web ID from token claims')
52+
error.statusCode = 401
53+
error.cause = err
54+
55+
next(error)
56+
})
5257
})
5358
}
5459

lib/models/authenticator.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ class TlsAuthenticator extends Authenticator {
317317
return Promise.resolve(this.accountManager.userAccountFrom({ webId }))
318318
}
319319

320-
debug(`WebID URI ${JSON.stringify(webId)} is not a local account, verifying preferred provider`)
320+
debug(`WebID URI ${JSON.stringify(webId)} is not a local account, verifying authorized provider`)
321321

322322
return this.discoverProviderFor(webId)
323323
.then(authorizedProvider => {

0 commit comments

Comments
 (0)