Temporarily disable PIS and TRAIN auth reference: #71
Signed-off-by: Fred Boniface <fred@fjla.uk>
This commit is contained in:
parent
ac9372515f
commit
8e0b928f27
@ -5,7 +5,7 @@ interface versions {
|
||||
|
||||
const version: versions = {
|
||||
api: ["/api/v2"],
|
||||
app: "2024.2.3",
|
||||
app: "2024.3.0",
|
||||
};
|
||||
|
||||
module.exports = version;
|
||||
|
@ -2,11 +2,11 @@ const pis = require("../services/pis.services");
|
||||
|
||||
/* Used in /api/v2 */
|
||||
async function byStartEndCRS(req, res, next) {
|
||||
if (!req.isAuthed) {
|
||||
const err = new Error("Unauthorized");
|
||||
err.status = 401;
|
||||
return next(err);
|
||||
}
|
||||
// if (!req.isAuthed) {
|
||||
// const err = new Error("Unauthorized");
|
||||
// err.status = 401;
|
||||
// return next(err);
|
||||
// }
|
||||
try {
|
||||
let startCrs = req.params.startCrs;
|
||||
let endCrs = req.params.endCrs;
|
||||
@ -19,11 +19,11 @@ async function byStartEndCRS(req, res, next) {
|
||||
|
||||
/* Used in /api/v2 */
|
||||
async function byCode(req, res, next) {
|
||||
if (!req.isAuthed) {
|
||||
const err = new Error("Unauthorized");
|
||||
err.status = 401;
|
||||
return next(err);
|
||||
}
|
||||
// if (!req.isAuthed) {
|
||||
// const err = new Error("Unauthorized");
|
||||
// err.status = 401;
|
||||
// return next(err);
|
||||
// }
|
||||
try {
|
||||
let code = req.params.code;
|
||||
res.json(await pis.findPisByCode(code));
|
||||
@ -34,11 +34,11 @@ async function byCode(req, res, next) {
|
||||
}
|
||||
|
||||
async function random(req, res, next) {
|
||||
if (!req.isAuthed) {
|
||||
const err = new Error("Unauthorized");
|
||||
err.status = 401;
|
||||
return next(err);
|
||||
}
|
||||
// if (!req.isAuthed) {
|
||||
// const err = new Error("Unauthorized");
|
||||
// err.status = 401;
|
||||
// return next(err);
|
||||
// }
|
||||
try {
|
||||
res.json(await pis.findRandom());
|
||||
} catch (err) {
|
||||
|
@ -5,11 +5,11 @@ const train = require("../services/trainService.services");
|
||||
async function getByHeadcodeToday(req, res, next) {
|
||||
// Deprecated - for future removal.
|
||||
logger.warn("Deprecated Function Called - trainService.services-getByHeadcodeToday")
|
||||
if (!req.isAuthed) {
|
||||
const err = new Error("Unauthorized");
|
||||
err.status = 401;
|
||||
next(err);
|
||||
}
|
||||
// if (!req.isAuthed) {
|
||||
// const err = new Error("Unauthorized");
|
||||
// err.status = 401;
|
||||
// next(err);
|
||||
// }
|
||||
try {
|
||||
var searchHeadcode = req.params.id;
|
||||
res.json(await train.findByHeadcodeToday(searchHeadcode));
|
||||
@ -21,11 +21,11 @@ async function getByHeadcodeToday(req, res, next) {
|
||||
}
|
||||
|
||||
async function get(req, res, next) {
|
||||
if (!req.isAuthed) {
|
||||
const err = new Error("Unauthorized");
|
||||
err.status = 401;
|
||||
next(err);
|
||||
}
|
||||
// if (!req.isAuthed) {
|
||||
// const err = new Error("Unauthorized");
|
||||
// err.status = 401;
|
||||
// next(err);
|
||||
// }
|
||||
let date = req.params.date;
|
||||
let searchType = req.params.searchType;
|
||||
let id = req.params.id;
|
||||
|
Loading…
Reference in New Issue
Block a user