Skip to content

Commit b16b137

Browse files
megothkjetilk
authored andcommitted
Laxing a bit on the endpoints you can visit on subdomains
Should be able to login and logout and keep tokens updated via endpoints on subdomain
1 parent 1bc05b1 commit b16b137

File tree

2 files changed

+10
-12
lines changed

2 files changed

+10
-12
lines changed

lib/api/authn/webid-oidc.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -67,29 +67,29 @@ function middleware (oidc) {
6767
const router = express.Router('/')
6868

6969
// User-facing Authentication API
70-
router.get(['/login', '/signin'], restrictToTopDomain, LoginRequest.get)
70+
router.get(['/login', '/signin'], LoginRequest.get)
7171

72-
router.post('/login/password', restrictToTopDomain, bodyParser, LoginRequest.loginPassword)
72+
router.post('/login/password', bodyParser, LoginRequest.loginPassword)
7373

74-
router.post('/login/tls', restrictToTopDomain, bodyParser, LoginRequest.loginTls)
74+
router.post('/login/tls', bodyParser, LoginRequest.loginTls)
7575

7676
router.get('/account/password/reset', restrictToTopDomain, PasswordResetEmailRequest.get)
7777
router.post('/account/password/reset', restrictToTopDomain, bodyParser, PasswordResetEmailRequest.post)
7878

7979
router.get('/account/password/change', restrictToTopDomain, PasswordChangeRequest.get)
8080
router.post('/account/password/change', restrictToTopDomain, bodyParser, PasswordChangeRequest.post)
8181

82-
router.get('/.well-known/solid/logout/', restrictToTopDomain, (req, res) => res.redirect('/logout'))
82+
router.get('/.well-known/solid/logout/', (req, res) => res.redirect('/logout'))
8383

84-
router.get('/goodbye', restrictToTopDomain, (req, res) => { res.render('auth/goodbye') })
84+
router.get('/goodbye', (req, res) => { res.render('auth/goodbye') })
8585

8686
// The relying party callback is called at the end of the OIDC signin process
87-
router.get('/api/oidc/rp/:issuer_id', restrictToTopDomain, AuthCallbackRequest.get)
87+
router.get('/api/oidc/rp/:issuer_id', AuthCallbackRequest.get)
8888

8989
// Static assets related to authentication
9090
const authAssets = [
91-
['/.well-known/solid/login/', '../static/popup-redirect.html', false, true],
92-
['/common/', 'solid-auth-client/dist-popup/popup.html', true, true]
91+
['/.well-known/solid/login/', '../static/popup-redirect.html', false],
92+
['/common/', 'solid-auth-client/dist-popup/popup.html']
9393
]
9494
authAssets.map(args => routeResolvedFile(router, ...args))
9595

lib/utils.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ const url = require('url')
2121
const debug = require('./debug').fs
2222
const getSize = require('get-folder-size')
2323
var ns = require('solid-namespace')($rdf)
24-
const restrictToTopDomainHandler = require('./handlers/restrict-to-top-domain')
2524

2625
/**
2726
* Returns a fully qualified URL from an Express.js Request object.
@@ -179,11 +178,10 @@ function stripLineEndings (obj) {
179178
/**
180179
* Adds a route that serves a static file from another Node module
181180
*/
182-
function routeResolvedFile (router, path, file, appendFileName = true, restrictToTopDomain = false) {
181+
function routeResolvedFile (router, path, file, appendFileName = true) {
183182
const fullPath = appendFileName ? path + file.match(/[^/]+$/) : path
184183
const fullFile = require.resolve(file)
185-
const restrictHandler = restrictToTopDomain ? restrictToTopDomainHandler : (req, res, next) => next()
186-
router.get(fullPath, restrictHandler, (req, res) => res.sendFile(fullFile))
184+
router.get(fullPath, (req, res) => res.sendFile(fullFile))
187185
}
188186

189187
/**

0 commit comments

Comments
 (0)