update Fr 29. Mai 22:01:01 CEST 2020
This commit is contained in:
parent
3c6431903e
commit
22ca5f47b3
@ -49,39 +49,12 @@ module.exports = function (app, sql, uuidv4, app_cfg, passport, auth, waip, udp)
|
|||||||
});
|
});
|
||||||
|
|
||||||
// API
|
// API
|
||||||
app.get('/api', function (req, res) {
|
app.get('/api', function (req, res, next) {
|
||||||
if (app_cfg.public.ext_privacy) {
|
var err = new Error('Sie sind nicht berechtigt diese Seite aufzurufen!');
|
||||||
res.redirect(app_cfg.public.url_privacy);
|
err.status = 403;
|
||||||
} else {
|
|
||||||
res.render('privacy', {
|
|
||||||
public: app_cfg.public,
|
|
||||||
title: 'Datenschutzerklärung',
|
|
||||||
user: req.user
|
|
||||||
});
|
|
||||||
};
|
|
||||||
});
|
|
||||||
|
|
||||||
// 404 abfangen und an error handler weiterleiten
|
|
||||||
app.use(function (req, res, next) {
|
|
||||||
var err = new Error('Seite nicht gefunden!');
|
|
||||||
err.status = 404;
|
|
||||||
next(err);
|
next(err);
|
||||||
});
|
});
|
||||||
|
|
||||||
// error handler
|
|
||||||
app.use(function (err, req, res, next) {
|
|
||||||
// set locals, only providing error in development
|
|
||||||
res.locals.message = err.message;
|
|
||||||
res.locals.error = app_cfg.global.development ? err : {};
|
|
||||||
// render the error page
|
|
||||||
res.status(err.status || 500);
|
|
||||||
res.render('error', {
|
|
||||||
public: app_cfg.public,
|
|
||||||
user: req.user
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* ##################### */
|
/* ##################### */
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user