Reorganizing
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
2023-05-03 11:12:59 -04:00
parent 27a78dd471
commit dc72cefece
23 changed files with 163 additions and 87 deletions

View File

@@ -0,0 +1,12 @@
import { Middleware } from 'koa';
import { LOGIN_ROUTE } from '../../constants/constants';
export const authenticated = (): Middleware => {
return (ctx, next) => {
if (ctx.isAuthenticated()) {
return next();
} else {
ctx.redirect(process.env.LOGIN_ROUTE || LOGIN_ROUTE);
}
};
};