Skip to content

Commit

Permalink
fix: make NNAS middleware only allow Basic tokens on "devices" endpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
jonbarrow committed Aug 9, 2024
1 parent cbf85fe commit 8deca40
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/middleware/pnid.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ async function PNIDMiddleware(request: express.Request, response: express.Respon
token = Buffer.from(token, 'hex').toString('base64');
}

if (type === 'Basic') {
if (type === 'Basic' && request.path.includes('v1/api/people/@me/devices')) {
pnid = await getPNIDByBasicAuth(token);
} else if (type === 'Bearer') {
// TODO - This "accepted types list" is mostly a hack. Change this
Expand Down

0 comments on commit 8deca40

Please sign in to comment.