Add basic login/logout logic

This commit is contained in:
Johannes Zellner
2020-02-04 14:35:25 +01:00
parent 57e3180737
commit 0ae9be4de9
3 changed files with 69 additions and 0 deletions

View File

@@ -139,6 +139,10 @@ function initializeExpressSync() {
router.get ('/api/v1/cloudron/avatar', routes.settings.getCloudronAvatar); // this is a public alias for /api/v1/settings/cloudron_avatar
// login/logout routes
router.post('/api/v1/cloudron/login', routes.cloudron.login);
router.get ('/api/v1/cloudron/logout', routes.cloudron.logout); // this will invalidate the token if any and redirect to /login.html always
// developer routes
router.post('/api/v1/developer/login', routes.developer.login);