mirror of
https://github.com/NginxProxyManager/nginx-proxy-manager.git
synced 2025-06-18 18:16:26 +00:00
Enforce token auth for odic config PUT call
This commit is contained in:
@ -4,9 +4,14 @@ module.exports = () => {
|
||||
return function (req, res, next) {
|
||||
res.locals.access = null;
|
||||
let access = new Access(res.locals.token || null);
|
||||
// allow unauthenticated access to OIDC configuration
|
||||
let anon_access = req.url === '/oidc-config' && !access.token.getUserId();
|
||||
access.load(anon_access)
|
||||
|
||||
// Allow unauthenticated access to get the oidc configuration
|
||||
let oidc_access =
|
||||
req.url === '/oidc-config' &&
|
||||
req.method === 'GET' &&
|
||||
!access.token.getUserId();
|
||||
|
||||
access.load(oidc_access)
|
||||
.then(() => {
|
||||
res.locals.access = access;
|
||||
next();
|
||||
|
Reference in New Issue
Block a user