Add authentication to PIS route

Signed-off-by: Fred Boniface <fred@fjla.uk>
This commit is contained in:
Fred Boniface 2023-04-30 18:21:42 +01:00
parent 04ffaafdd9
commit c22b6bf4eb

4
app.js
View File

@ -73,10 +73,10 @@ app.use('/api/v1/find', findRtr);
app.use('/api/v1/issue', issueRtr);
app.use('/api/v1/stats', statRtr);
app.use('/api/v1/register', regRtr);
app.use('/api/v1/pis', pisRtr)
// Authented Routes
app.use('/api/v1/ldbs', authenticate)
app.use('/api/v1/ldbs', authenticate, (req, res) => res.status(501).json({status: "Not Implemented", message: "This feature is not yet implemented due to upstream issues"}))
app.use('/api/v1/pis', authenticate, pisRtr)
app.use('/api/v1/auth/test', authenticate, (req, res) => res.status(200).json({status: "ok", message: "Authentication successful"})) // Returns 401 if auth failed, 200 if successful.
// Number of proxies: