cleanup status route
this is now purely a healthcheck route and nothing else at some point, we will server render password reset and setup account views
This commit is contained in:
@@ -134,9 +134,6 @@ async function runStartupTasks() {
|
||||
async function getStatus() {
|
||||
return {
|
||||
version: constants.VERSION,
|
||||
cloudronName: await branding.getCloudronName(), // still used in passwordreset and setupaccount views
|
||||
footer: await branding.renderFooter(), // still used in passwordreset and setupaccount views
|
||||
language: await getLanguage(), // still used in passwordreset and setupaccount views
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -6,11 +6,14 @@ exports = module.exports = {
|
||||
passwordResetRequest,
|
||||
passwordReset,
|
||||
setupAccount,
|
||||
getBranding
|
||||
};
|
||||
|
||||
const assert = require('assert'),
|
||||
AuditSource = require('../auditsource.js'),
|
||||
BoxError = require('../boxerror.js'),
|
||||
branding = require('../branding.js'),
|
||||
cloudron = require('../cloudron.js'),
|
||||
constants = require('../constants.js'),
|
||||
debug = require('debug')('box:routes/cloudron'),
|
||||
eventlog = require('../eventlog.js'),
|
||||
@@ -115,3 +118,15 @@ async function setupAccount(req, res, next) {
|
||||
|
||||
next(new HttpSuccess(201, { accessToken }));
|
||||
}
|
||||
|
||||
async function getBranding(req, res, next) {
|
||||
// still used in passwordreset and setupaccount views. we should server render them
|
||||
const result = {
|
||||
cloudronName: await branding.getCloudronName(),
|
||||
footer: await branding.renderFooter(),
|
||||
language: await cloudron.getLanguage(),
|
||||
};
|
||||
|
||||
next(new HttpSuccess(200, result));
|
||||
|
||||
}
|
||||
+2
-1
@@ -105,8 +105,9 @@ async function initializeExpressSync() {
|
||||
router.post('/api/v1/auth/password_reset_request', json, routes.auth.passwordResetRequest);
|
||||
router.post('/api/v1/auth/password_reset', json, routes.auth.passwordReset);
|
||||
router.post('/api/v1/auth/setup_account', json, routes.auth.setupAccount);
|
||||
router.post('/api/v1/auth/branding', routes.auth.getBranding); // temp route until we server side render password_reset and setup_account
|
||||
|
||||
// config route (for dashboard). can return some private configuration unlike status
|
||||
// config route for dashboard that any auth user (not just admin) can access
|
||||
router.get ('/api/v1/config', token, authorizeUser, routes.cloudron.getConfig);
|
||||
router.get ('/api/v1/platform_status', token, authorizeUser, routes.cloudron.getPlatformStatus);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user