fix: push back some deprecations, remove deprecated stuff scheduled for v1.18.0

This commit is contained in:
Julian Lam
2021-09-03 12:04:16 -04:00
parent 1f91a31327
commit dd4e66e22c
5 changed files with 4 additions and 38 deletions

View File

@@ -82,7 +82,7 @@ module.exports = function (middleware) {
return !res.headersSent;
}
// TODO: Remove in v1.18.0
// TODO: Remove in v1.19.0
middleware.authenticate = helpers.try(async (req, res, next) => {
winston.warn(`[middleware] middleware.authenticate has been deprecated, page and API routes are now automatically authenticated via setup(Page|API)Route. Use middleware.authenticateRequest (if not using route helper) and middleware.ensureLoggedIn instead. (request path: ${req.path})`);
if (!await authenticate(req, res)) {
@@ -101,7 +101,7 @@ module.exports = function (middleware) {
next();
});
// TODO: Remove in v1.18.0
// TODO: Remove in v1.19.0
middleware.authenticateOrGuest = (req, res, next) => {
winston.warn(`[middleware] middleware.authenticateOrGuest has been renamed, use middleware.authenticateRequest instead. (request path: ${req.path})`);
middleware.authenticateRequest(req, res, next);