Files
planka/server/api/policies/is-authenticated.js
2025-11-06 20:56:48 +01:00

14 lines
401 B
JavaScript
Executable File

/*!
* Copyright (c) 2024 PLANKA Software GmbH
* Licensed under the Fair Use License: https://github.com/plankanban/planka/blob/master/LICENSE.md
*/
module.exports = async function isAuthenticated(req, res, proceed) {
if (!req.currentUser) {
// TODO: provide separate error for API keys?
return res.unauthorized('Access token is missing, invalid or expired');
}
return proceed();
};