|
|
@@ -27,6 +27,7 @@ module.exports = function(crowi, app) {
|
|
|
const adminRequired = require('../middlewares/admin-required')(crowi);
|
|
|
const certifySharedFile = require('../middlewares/certify-shared-file')(crowi);
|
|
|
const csrf = require('../middlewares/csrf')(crowi);
|
|
|
+ const injectUserUISettings = require('../middlewares/inject-user-ui-settings-to-localvars')();
|
|
|
|
|
|
const uploads = multer({ dest: `${crowi.tmpDir}uploads` });
|
|
|
const form = require('../form');
|
|
|
@@ -51,7 +52,7 @@ module.exports = function(crowi, app) {
|
|
|
app.use('/api-docs', require('./apiv3/docs')(crowi));
|
|
|
app.use('/_api/v3', require('./apiv3')(crowi));
|
|
|
|
|
|
- app.get('/' , applicationInstalled, loginRequired , autoReconnectToSearch, page.showTopPage);
|
|
|
+ app.get('/' , applicationInstalled, loginRequired, autoReconnectToSearch, injectUserUISettings, page.showTopPage);
|
|
|
|
|
|
app.get('/login/error/:reason' , applicationInstalled, login.error);
|
|
|
app.get('/login' , applicationInstalled, login.preLogin, login.login);
|
|
|
@@ -131,23 +132,23 @@ module.exports = function(crowi, app) {
|
|
|
app.get('/admin/export' , loginRequiredStrictly , adminRequired ,admin.export.index);
|
|
|
app.get('/admin/export/:fileName' , loginRequiredStrictly , adminRequired ,admin.export.api.validators.export.download(), admin.export.download);
|
|
|
|
|
|
- app.get('/admin/*' , loginRequiredStrictly ,adminRequired, admin.notFound.index);
|
|
|
+ app.get('/admin/*' , loginRequiredStrictly ,adminRequired, admin.notFound.index);
|
|
|
|
|
|
- app.get('/me' , loginRequiredStrictly , me.index);
|
|
|
+ app.get('/me' , loginRequiredStrictly, injectUserUISettings, me.index);
|
|
|
// external-accounts
|
|
|
- app.get('/me/external-accounts' , loginRequiredStrictly , me.externalAccounts.list);
|
|
|
+ app.get('/me/external-accounts' , loginRequiredStrictly, injectUserUISettings, me.externalAccounts.list);
|
|
|
// my drafts
|
|
|
- app.get('/me/drafts' , loginRequiredStrictly, me.drafts.list);
|
|
|
+ app.get('/me/drafts' , loginRequiredStrictly, injectUserUISettings, me.drafts.list);
|
|
|
|
|
|
- app.get('/:id([0-9a-z]{24})' , loginRequired , page.redirector);
|
|
|
- app.get('/_r/:id([0-9a-z]{24})' , loginRequired , page.redirector); // alias
|
|
|
- app.get('/attachment/:id([0-9a-z]{24})' , certifySharedFile , loginRequired, attachment.api.get);
|
|
|
+ app.get('/:id([0-9a-z]{24})' , loginRequired , page.redirector);
|
|
|
+ app.get('/_r/:id([0-9a-z]{24})' , loginRequired , page.redirector); // alias
|
|
|
+ app.get('/attachment/:id([0-9a-z]{24})' , certifySharedFile , loginRequired, attachment.api.get);
|
|
|
app.get('/attachment/profile/:id([0-9a-z]{24})' , loginRequired, attachment.api.get);
|
|
|
- app.get('/attachment/:pageId/:fileName', loginRequired, attachment.api.obsoletedGetForMongoDB); // DEPRECATED: remains for backward compatibility for v3.3.x or below
|
|
|
- app.get('/download/:id([0-9a-z]{24})' , loginRequired, attachment.api.download);
|
|
|
+ app.get('/attachment/:pageId/:fileName' , loginRequired, attachment.api.obsoletedGetForMongoDB); // DEPRECATED: remains for backward compatibility for v3.3.x or below
|
|
|
+ app.get('/download/:id([0-9a-z]{24})' , loginRequired, attachment.api.download);
|
|
|
|
|
|
- app.get('/_search' , loginRequired , search.searchPage);
|
|
|
- app.get('/_api/search' , accessTokenParser , loginRequired , search.api.search);
|
|
|
+ app.get('/_search' , loginRequired, injectUserUISettings, search.searchPage);
|
|
|
+ app.get('/_api/search' , accessTokenParser , loginRequired , search.api.search);
|
|
|
|
|
|
app.get('/_api/check_username' , user.api.checkUsername);
|
|
|
app.get('/_api/me/user-group-relations' , accessTokenParser , loginRequiredStrictly , me.api.userGroupRelations);
|
|
|
@@ -178,9 +179,9 @@ module.exports = function(crowi, app) {
|
|
|
app.post('/_api/attachments.removeProfileImage' , accessTokenParser , loginRequiredStrictly , csrf, attachment.api.removeProfileImage);
|
|
|
app.get('/_api/attachments.limit' , accessTokenParser , loginRequiredStrictly, attachment.api.limit);
|
|
|
|
|
|
- app.get('/trash$' , loginRequired , page.trashPageShowWrapper);
|
|
|
- app.get('/trash/$' , loginRequired , page.trashPageListShowWrapper);
|
|
|
- app.get('/trash/*/$' , loginRequired , page.deletedPageListShowWrapper);
|
|
|
+ app.get('/trash$' , loginRequired, injectUserUISettings, page.trashPageShowWrapper);
|
|
|
+ app.get('/trash/$' , loginRequired, injectUserUISettings, page.trashPageListShowWrapper);
|
|
|
+ app.get('/trash/*/$' , loginRequired, injectUserUISettings, page.deletedPageListShowWrapper);
|
|
|
|
|
|
app.get('/_hackmd/load-agent' , hackmd.loadAgent);
|
|
|
app.get('/_hackmd/load-styles' , hackmd.loadStyles);
|
|
|
@@ -195,7 +196,7 @@ module.exports = function(crowi, app) {
|
|
|
|
|
|
app.get('/share/:linkId', page.showSharedPage);
|
|
|
|
|
|
- app.get('/*/$' , loginRequired , page.showPageWithEndOfSlash, page.notFound);
|
|
|
- app.get('/*' , loginRequired , autoReconnectToSearch, page.showPage, page.notFound);
|
|
|
+ app.get('/*/$' , loginRequired, injectUserUISettings, page.showPageWithEndOfSlash, page.notFound);
|
|
|
+ app.get('/*' , loginRequired, autoReconnectToSearch, injectUserUISettings, page.showPage, page.notFound);
|
|
|
|
|
|
};
|